I am using the docker-publish.yml Github workflow to build and publish a Docker image on Github. The image is built successfully, but the workflow fails at the "Post Build and push Docker image" without any error message. Here is a link to the run, including the logs. It might be the size of the image, but I cannot tell. Any suggestions will be appreciated.
Related
I'm having a problem building Docker images using GitHub workflow but I can succeed locally.
picture
I have a Dockerfile with ARG before first FROM.
It builds correctly on my server (Docker version 20.10.7) however when I try to build it as part of GitLab CICD (GitLab version 13.7.4) within a DinD container (image docker:20.10.7) the build fails with the following message:
Please provide a source image with `from` prior to commit
I'll appreciate help with resolving this issue.
Thanks,
Barak
I'm attempting to run a Bamboo (private server) task that builds a docker image. The dockerfile builds from an image on google container registry. gcr.io/project-name/image-name:tag. However, whenever my task is triggered, I get a build error.
Checking the log, the issue appears to be:
build 23-Aug-2018 20:08:52 Sending build context to Docker daemon 3.072 kB
build 23-Aug-2018 20:08:52
build 23-Aug-2018 20:08:52 Step 1 : FROM gcr.io/project-name/image-name:tag
build 23-Aug-2018 20:08:52 Trying to pull repository gcr.io/project-name/image-name ...
build 23-Aug-2018 20:08:52 Pulling repository gcr.io/project-name/image-name
error 23-Aug-2018 20:08:52 Error: Status 405 trying to pull repository project-name/image-name: "v1 Registry API is disabled. If you are not explicitly using the v1 Registry API, it is possible your v2 image could not be found. Verify that your image is available, or retry with `dockerd --disable-legacy-registry`. See https://cloud.google.com/container-registry/docs/support/deprecation-notices"
simple 23-Aug-2018 20:08:52 Failing task since return code of [/usr/bin/docker build --no-cache=true --force-rm=true --tag=gcr.io/project-name/out_image-name:outer_tag /var/atlassian/application-data/bamboo/xml-data/build-dir/3997697/AN-CA-JOB1] was 149 while expected 0
Looking into the error, I came across this google troubleshooting page, which suggests confirming the names are right. Running the command, I can confirm the name returns results.
Additionally, the "retry with dockerd --disable-legacy-registry" suggestion seems dated, since the Docker docs say:
The disable-legacy-registry configuration option has been removed and,
when used, will produce an error on daemon startup.
What am I doing wrong?
Other details:
Bamboo version 6.4.1 build 60405
Turns out the issue is an outdated version of Docker.
I have a docker hub repository configured for automated builds. see image below. When I press the "save and trigger build" I get an error page saying nothing more than "Oops, there was an error!".
I tried emailing docker support, but in vain.
Any idea why this is happening and how to resolve?
This was resolved by Docker support so I'm posting here for anyone who might get into that as well. It appears that Docker was having an issue with bitbucket integration and it is now solved.
I am currently working on integrating Docker with Jenkins and I am currently trying to figure out the following pipeline:
Whenever a Dockerfile is updated in GIT, trigger a Jenkins Job to do the following
Build the Docker image
List item
Test, Verify the Docker image
Version the image - Prod, testing etc.
Push the image to the registry
If the image is not built, have a proper mechanism to get the logs
From my research, I found that we have 2 different plugins for Jenkins for Docker integration - Build step plugin and Docker build publish plugin. As far as I could see, I could not see any plugins or workflow to test the image before pushing it to the repository. Since we are doing this from the scratch, I would like to know the best tried and tested workflow.
Any help appreciated.
We applied the same mindset like "git flow" to the creation of docker images. In our solution, there was no need for testing the image itself. We solved that splitting up the Build in to a "Source-Build" producing artifacts and a downstream job e.g. "Runtime-Build" only packaging the artifacts into the runtime and pushing into the registry. At this point the whole stack is delivered to a "Release-Stage" for automatic testing.
To test the image there's a tool called Anchore.
Then, if you want to integrate other types of tests before building the Docker image, you can integrate for example Sonarqube with Jenkins and do a static analysis of the source code. Full example at: https://pillsfromtheweb.blogspot.com/2020/05/integrate-sonarqube-static-analysis-in.html