build-push-action | GitHub Action to build and push Docker images with Buildx | Continuous Deployment library

 by   docker TypeScript Version: v4.1.0 License: Apache-2.0

kandi X-RAY | build-push-action Summary

kandi X-RAY | build-push-action Summary

build-push-action is a TypeScript library typically used in Devops, Continuous Deployment, Docker applications. build-push-action has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

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

            kandi-support Support

              build-push-action has a medium active ecosystem.
              It has 3348 star(s) with 505 fork(s). There are 34 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 39 open issues and 501 have been closed. On average issues are closed in 29 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of build-push-action is v4.1.0

            kandi-Quality Quality

              build-push-action has 0 bugs and 0 code smells.

            kandi-Security Security

              build-push-action has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              build-push-action code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              build-push-action is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              build-push-action releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of build-push-action
            Get all kandi verified functions for this library.

            build-push-action Key Features

            No Key Features are available at this moment for build-push-action.

            build-push-action Examples and Code Snippets

            No Code Snippets are available at this moment for build-push-action.

            Community Discussions

            QUESTION

            Accessing another private GitHub repository in Docker image build & GitHub Action context
            Asked 2022-Apr-05 at 10:03

            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:47

            You 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

            Source https://stackoverflow.com/questions/71711975

            QUESTION

            How to reference the imageid from a docker build using docker/build-push-action@v2?
            Asked 2022-Mar-21 at 23:01

            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:01

            You 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:

            Source https://stackoverflow.com/questions/71564486

            QUESTION

            Visual Studio docker-compose build context
            Asked 2022-Mar-15 at 15:58

            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:58

            With docker/build-push-action@v2 you can specify the context and the location of the docker file like so:

            Source https://stackoverflow.com/questions/71408409

            QUESTION

            Am I misunderstand something? Unexpected behaviour in github actions
            Asked 2022-Mar-15 at 11:20

            So I have a github workflow with job like this:

            ...

            ANSWER

            Answered 2022-Mar-15 at 11:20

            As you can see on the Ubuntu-20.04 virtual environment, it is provided with some Rust Tools installed:

            Source https://stackoverflow.com/questions/71467601

            QUESTION

            GITHUB_TOKEN permission denied write package when build and push docker in github workflows
            Asked 2022-Mar-13 at 14:53

            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:24

            Check 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.

            Source https://stackoverflow.com/questions/70646920

            QUESTION

            How can I copy `.git` directory to the container with GitHub actions?
            Asked 2022-Feb-17 at 14:17

            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:17

            The 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:

            Source https://stackoverflow.com/questions/71157844

            QUESTION

            Create Docker Image From Github and Publish to Hub
            Asked 2022-Jan-30 at 23:51

            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:06

            You 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):

            Source https://stackoverflow.com/questions/70915000

            QUESTION

            GitHub Actions - Specify Multiple Tags with docker/build-push-action@v2
            Asked 2022-Jan-26 at 20:07

            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:07

            QUESTION

            GitHub Actions Cannot Find JAR file in Target Directory
            Asked 2022-Jan-10 at 02:17

            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:17

            I 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 ?

            Source https://stackoverflow.com/questions/70644104

            QUESTION

            How to build an Docker image with GitHub actions using uncommited local certificate files
            Asked 2021-Dec-18 at 11:39

            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:39

            Well 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:

            1. 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

            1. 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:

            Source https://stackoverflow.com/questions/70402788

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install build-push-action

            v2 of this action includes significant updates and now uses Docker Buildx. It's also rewritten as a typescript-action to be as close as possible of the GitHub Runner during its execution. Upgrade notes with many usage examples have been added to handle most use cases but v1 is still available through releases/v1 branch.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/docker/build-push-action.git

          • CLI

            gh repo clone docker/build-push-action

          • sshUrl

            git@github.com:docker/build-push-action.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link