Can't get CI to use latest Docker image

My builds keep using an out of date version of my docker image. The image is at https://github.com/simonh1000/docker-elm/blob/master/Dockerfile and the ci config is at https://github.com/simonh1000/elm-webpack-starter/blob/ci/.circleci/config.yml

When the tests run they use an old version of Dockerfile that installs an older version of elm-test (beta9), which has a bug in it preventing CI finishing. https://hub.docker.com/r/hotbelgo/docker-elm/ is the url for the docker i’m trying to use

Can we see your build logs? There’s not much to go on here. Your image is based on hotbelgo/docker-elm:latest. Have a look at the ‘spin up’ phase to see if the image hash is changed when you believe it should be.

thanks and apologies - i’m new to this so not sure what is needed. Here are the logs. The latest build on github for the docker is 6e99d1f57b3024a641d4c4adb9e86eee93198dd0 and that does not seem to be the hash we see below

Build-agent version 0.1.900-892a9f73 (2018-10-25T15:49:42+0000)
Starting container hotbelgo/docker-elm
  image cache not found on this host, downloading hotbelgo/docker-elm
latest: Pulling from hotbelgo/docker-elm
61be48634cb9: Already exists
fa696905a590: Already exists
b6dd2322bbef: Already exists
32477089adb4: Already exists
febe7209ec28: Already exists
4364cbe57162: Already exists
ace5c680ff94: Already exists
4acd6a9b7a48: Already exists
f7309a220cb3: Pulling fs layer
f7309a220cb3: Verifying Checksum
f7309a220cb3: Download complete
f7309a220cb3: Pull complete
Digest: sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d
Status: Downloaded newer image for hotbelgo/docker-elm:latest
  using image hotbelgo/docker-elm@sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d

Using build environment variables:
  BASH_ENV=/tmp/.bash_env-5bd407c6270e440001c8bd6e-0-build
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=ci
  CIRCLE_BUILD_NUM=68
  CIRCLE_BUILD_URL=https://circleci.com/gh/simonh1000/elm-webpack-starter/68
  CIRCLE_COMPARE_URL=https://github.com/simonh1000/elm-webpack-starter/compare/427cc9240db4...5216bb014e20

Right, you are mixing up Git commit hashes with Docker image digests; they are both hashes, but they are very different things. The hash that you mention (6e99d1f57b3024a641d4c4adb9e86eee93198dd0) is the last commit hash in GitHub, whereas the digest in your Docker operation is 6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d.

Oddly, the image digest I get is different; I just pulled your image from Docker Hub, and I get this hash:

docker pull hotbelgo/docker-elm
Using default tag: latest
latest: Pulling from hotbelgo/docker-elm
61be48634cb9: Pull complete 
fa696905a590: Pull complete 
b6dd2322bbef: Pull complete 
32477089adb4: Pull complete 
febe7209ec28: Pull complete 
4364cbe57162: Pull complete 
ace5c680ff94: Pull complete 
4acd6a9b7a48: Pull complete 
39e065ed4e16: Pull complete 
Digest: sha256:4fd02ff64df88aeee5a9485328591d1a31df64f36a735b9583dabc55449b1630
Status: Downloaded newer image for hotbelgo/docker-elm:latest

It may be worth checking your build process again, since you may have copied the wrong data.

I just tried pulling by hash, and it does seem to be an old one:

docker pull hotbelgo/docker-elm@sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d
sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d: Pulling from hotbelgo/docker-elm
61be48634cb9: Already exists 
fa696905a590: Already exists 
b6dd2322bbef: Already exists 
32477089adb4: Already exists 
febe7209ec28: Already exists 
4364cbe57162: Already exists 
ace5c680ff94: Already exists 
4acd6a9b7a48: Already exists 
f7309a220cb3: Pull complete 
Digest: sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d
Status: Downloaded newer image for hotbelgo/docker-elm@sha256:6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d

So, re-run your project that uses this image, and re-check the digest.

thanks a lot. I understand (perhaps incorrectly) you to say that Docker has the right information, but that Circle is not downloading it properly.

So I tried to delete everything that I could see that was deletable on Circle and then recreating the project, but I still get the same, wrong, version of elm-test coming through.

That is not my view. I think you have mixed up Git commit hashes and Docker image digests. I am not (yet) convinced CircleCI is doing anything wrong.

The digest you mention 6fe223b1fda01e0429096da6fe56fd489fc2d40a864a09c5f60129f159e1102d is indeed an old image, and 4fd02ff64df88aeee5a9485328591d1a31df64f36a735b9583dabc55449b1630 is the latest image (true as of yesterday, although I can see from Docker Hub you pushed a new image two hours ago).

Are you able to paste a link to your Circle build here, so we can see what digest it is pulling?

Apologies for my misunderstanding - I’m way out of my depth here. https://circleci.com/gh/simonh1000/elm-webpack-starter/75 is the latest failed build I have

No worries. So, your spin-up logs for build 75 are thus:

Build-agent version 0.1.900-892a9f73 (2018-10-25T15:49:42+0000)
Starting container hotbelgo/docker-elm
  image cache not found on this host, downloading hotbelgo/docker-elm
latest: Pulling from hotbelgo/docker-elm
61be48634cb9: Already exists
fa696905a590: Already exists
b6dd2322bbef: Already exists
32477089adb4: Already exists
febe7209ec28: Already exists
4364cbe57162: Already exists
ace5c680ff94: Already exists
4acd6a9b7a48: Already exists
7eaa5aa5b595: Pulling fs layer
7eaa5aa5b595: Download complete
7eaa5aa5b595: Pull complete
Digest: sha256:cf41831146a729821c0a15614077e96d75af562844a4d6cf579aff78b8291538
Status: Downloaded newer image for hotbelgo/docker-elm:latest
  using image hotbelgo/docker-elm@sha256:cf41831146a729821c0a15614077e96d75af562844a4d6cf579aff78b8291538

So, this is saying that CircleCI believes your latest image is cf41831146a729821c0a15614077e96d75af562844a4d6cf579aff78b8291538.

I just did a new pull on my laptop, and I get this:

docker pull hotbelgo/docker-elm
Using default tag: latest
latest: Pulling from hotbelgo/docker-elm
61be48634cb9: Already exists 
fa696905a590: Already exists 
b6dd2322bbef: Already exists 
32477089adb4: Already exists 
febe7209ec28: Already exists 
4364cbe57162: Already exists 
ace5c680ff94: Already exists 
4acd6a9b7a48: Already exists 
7eaa5aa5b595: Pull complete 
Digest: sha256:cf41831146a729821c0a15614077e96d75af562844a4d6cf579aff78b8291538
Status: Downloaded newer image for hotbelgo/docker-elm:latest

Thus, the image digest on Docker Hub and CircleCI are the same. In other words, CircleCI is working correctly.

If the software within this image is not as you expect, then the image is not being built with the right versions.

In case you do not know about it, CircleCI offers an SSH feature - just use it to do a rebuild with an SSH port open. You can then connect to your post-failed build container, and examine what went wrong. You can examine versions of things here.

Or, of course, pull the image to your machine and get a shell on it, to do the same thing.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.