build-push-action | GitHub Action to build and push Docker images with Buildx | Continuous Deployment library
kandi X-RAY | build-push-action Summary
kandi X-RAY | build-push-action Summary
GitHub Action to build and push Docker images with Buildx with full support of the features provided by Moby BuildKit builder toolkit. This includes multi-platform build, secrets, remote cache, etc. and different builder deployment/namespacing options.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of build-push-action
build-push-action Key Features
build-push-action Examples and Code Snippets
Community Discussions
Trending Discussions on build-push-action
QUESTION
I'm trying to build my Docker image with GitHub action using the official docker/build-push-action action. The action provides secret GIT_AUTH_TOKEN for the build by default but I seem not to be able to use the token to read another private repository from the same organization (install pip package). The same Dockerfile builds fine locally when I provide a working token for the build.
Am I supposed to be able to use the default GIT_AUTH_TOKEN or do I need to retrieve a token from Secrets Manager as we do on Jenkins that I'm trying to get rid of. Thanks for your help!
...ANSWER
Answered 2022-Apr-01 at 19:47You have to generate a different PAT to clone the other repo. Bring that token in as a secret and use it in your workflow to checkout
QUESTION
I want to reference the imageid from the docker build using docker/build-push-action@v2 action in my next github action step when deploying to kubernetes using a Helm chart. For now I just want to echo it out in the next part of my github action step.
This is the github documentation link for build-push-action
The following is a snippet of my github action worfklow:
...ANSWER
Answered 2022-Mar-21 at 23:01You can reference the imageId
as described in the output section of the doc. Just add an id at your current job just for reference, as example:
QUESTION
When adding container orchastrator support (docker-compose) to a .NET Core Web API project with a dependency on some project library the following folder structure is created
...ANSWER
Answered 2022-Mar-15 at 15:58With docker/build-push-action@v2 you can specify the context and the location of the docker file like so:
QUESTION
So I have a github workflow with job like this:
...ANSWER
Answered 2022-Mar-15 at 11:20As you can see on the Ubuntu-20.04 virtual environment, it is provided with some Rust Tools installed:
QUESTION
I have a Github organization and try to migrate container registry from docker hub
to GitHub Packages
. By using Github Workflows, here's the yaml I used to push docker to GitHub Packages
:
ANSWER
Answered 2022-Jan-10 at 08:24Check if this is related to actions/runner issue 1039
Seems like GITHUB_TOKEN works only on default branch... You need to use custom PAT when running on PR branches
Check also if this is similar to this discussion:
It turns out another org member had pushed the same package, which was private by default and was owned by that org member.
Since nobody else could even see the package as existing, we were very confused.I think this default behavior of new packages being privately owned by the user uploading and not being visible to even the org owners is quite confusing.
If not, try, as described here, to do the push manually, in order to validate your token (with a docker login -u USERNAME -p TOKEN ghcr.io
, then a docker push
). The GitHub action might then work.
QUESTION
I have a GitHub actions CI which builds a my app in the last version of this app .git
directory is mandatory for building it the problem is that GitHub action don't remove it in the docker build step of the CI.
Here is my CI template:
...ANSWER
Answered 2022-Feb-17 at 14:17The issue is in the docker/build-push-action@v2 action, which by default ignores the checkout created using the actions/checkout@v2
action:
By default, this action uses the Git context so you don't need to use the actions/checkout action to check out the repository because this will be done directly by BuildKit.
The git reference will be based on the event that triggered your workflow and will result in the following context:
https://github.com//.git#
.
When you pass a git
build context to docker build
, it won't
include the .git
directory.
If you read through the documentation for the docker/build-push-action@v2
action, you'll see that you can override this behavior:
However, you can use the Path context using the context input alongside the actions/checkout action to remove this restriction.
You would need to modify your workflow so that it includes an explicit
context: .
, like this:
QUESTION
My github repository link is https://github.com/ferdasonmez/oyente. I forked a github site and made sme changes on some lib versions. Now I want to push it to Docker. I already created a repository under my docker account. ferdaozdemir/oyente
Using the below yml file, I am trying to create the image but nothing happens. I already created the secrets for Docker under Github settings. This can easily be recreated by forking the repository and entering your own secrets.
...ANSWER
Answered 2022-Jan-30 at 14:06You may be missing steps. I have some repos with a similar setup (i.e. Dockerfile
in the top-level directory) but I also run steps to
- checkout
- build (where I now use buildx)
- log into the Docker Hub
- build and push
- and also report and commit a timestamp (to force cache changes)
I include one of these below (source is here. It may not be the most minimal setup but it had been working for me quite reliably, including via scheduled (i.e cron
) actions. I am skipping the last two items here (see here for the complete file):
QUESTION
Is there a way to specify multiple tags when using docker/build-push-action@v2
?
I tried specifying multiple tags separated by a space or comma and they both failed.
Error
...ANSWER
Answered 2022-Jan-26 at 20:07Check here https://github.com/docker/build-push-action#customizing, add comma between the tags..
QUESTION
I am trying to use GitHub Actions to build a Docker image and publish it to Docker Hub.
I'm getting an error during the Build and push
step when it is attempting to build the Docker image because it cannot find the target
directory.
The Docker build step is looking in /tmp/buildkit-mount147850474/target
but my JAR is in /home/runner/work/myrepo/myrepo/target/app-0.0.1-SNAPSHOT.jar
.
How do I tell the Docker build step to use the correct directory?
I looked at working-directory
but the documentation says it is only for run
steps.
Error
...ANSWER
Answered 2022-Jan-10 at 02:17I have a similar pipeline but when I use docker/build-push-action:
- I have no working-directory param
- I have a context param set to current directory in with map
Could you try to modify your Build and push step like this ?
QUESTION
I have set up a GitHub actions workflow, where when I push code to a branch in my repo, GitHub actions help me build an image of that repo and push it to Docker Hub, which work fine.
The thing is that I now have certificate-files that I want to keep locally (i.e. not push up to my GitHub repo) - but that also means that the GitHub actions don't have access to them when building the image, and thus they don't get included in the built image on Docker Hub which I use to pull from into my production server - where I now don't have my certificate files. How can I set up GitHub actions to in some way build the image by using local files? Or is there a better way to solve this?
My GitHub actions file
...ANSWER
Answered 2021-Dec-18 at 11:39Well now I feel stupid :)
I got all into thinking about how to solve it by including it on the build-stage of the image, and didn't think of that when you start the built image you can choose to use "volumes" that resides on the machine you are starting the docker image from.
It was as simple as:
- Copy the folder with my certificate files from my local version of my GitHub repo to the remote version of my repo at my server with SCP, for example:
scp -r $(pwd)/Certificates_prod user@server:/path/to/repo/on/server
- Go into your docker-compose file and go under the container that is supposed to use the certificate-files and add the folder as a mounted volume, for example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install build-push-action
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page