Running a build with empty build args builds and pushes an image with no name
See original GitHub issueDescription
I recently ran this action in a workflow, with my repo name nicely lowercased (docker/build-push-action#37), but had one of my build args configured incorrectly. Note the environment variable BUILD_env=test
, which should have been BUILD_ENV=test
. My Dockerfile has default build args set (like ARG BUILD_ENV=development
), but the build arg here was probably overwriting that. My bad.
However, the action actually sets the image name to []
, kicks off a Docker build, completes the build, and attempts to push an image named []
.
Specific image name below replaced with org/repo/image
.
Run docker/build-push-action@v1
with:
username: br3ndonland
password: ***
build_args: BUILD_ENV=
registry: docker.pkg.github.com
repository: org/repo/image
tag_with_ref: false
tag_with_sha: false
path: .
always_pull: false
add_git_labels: false
push: true
env:
DOCKER_REPO: org/repo
BUILD_env: test
...
Logging in to registry docker.pkg.github.com
Login Succeeded
Building image []
Sending build context to Docker daemon 301.6kB
...
Removing intermediate container c6704dceaa3b
---> 2a565e64a9ba
Successfully built 2a565e64a9ba
Pushing image []
Suggestions
- The action should correctly read image names.
- If the action doesn’t receive a name, it should stop and throw an error, rather than going through the entire build and push process.
Related
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
docker build - Docker Documentation
The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in...
Read more >Docker, one or more build-args were not consumed
In simple Word, If you pass ARGs like --build-arg SOME_ARG=some_value to Docker build and did not declare the ARGS in Dockerfile this warning ......
Read more >Six Ways to Build Docker Images Faster (Even in Seconds)
Using pre-built Docker images Another way to solve the problem of a clear Docker cache is to move some of the layers to...
Read more >Chapter 8. Builds OpenShift Container Platform 3.11
The destination must be a relative directory path. At build time, the image will be loaded and the indicated files and directories will...
Read more >Docker Plugin — sbt-native-packager 1.9.0 documentation
The docker binary used by the build should already have been configured with the ... Builds an image using the local Docker server,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mickel8 https://github.com/docker/build-push-action/issues/380#issuecomment-855477968
Is there an example for defining Docker
build-arg
? I can’t see anything like this.I wanted to do something like this
--build-arg=VERSION=$(git describe)
but can’t manage to include this in workflow