makefiles/docker.inc.mk: always pull to keep image up-to-date#20470
makefiles/docker.inc.mk: always pull to keep image up-to-date#20470mguetschow wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
maribu
left a comment
There was a problem hiding this comment.
Thx for addressing this. Just a week ago the issue with an outdated container popped up in an issue, so this improves quality of life a lot.
|
Ah, two corner cases: What happens when sitting in a train in Brandenburg? (For the non-Germans: There is no Internet connectivity in Brandenburg.) What happens when a local docker image is passed to be used instead of the default one? |
As you can see, very good points! Should we have an environment/Makefile variable to explicitly disable pulling? |
| DOCKER_USER ?= $$(id -u) | ||
| DOCKER_USER_OPT = $(if $(_docker_is_podman),--userns keep-id,--user $(DOCKER_USER)) | ||
| DOCKER_RUN_FLAGS ?= --rm --tty $(DOCKER_USER_OPT) | ||
| DOCKER_RUN_FLAGS ?= --pull=always --rm --tty $(DOCKER_USER_OPT) |
There was a problem hiding this comment.
| DOCKER_RUN_FLAGS ?= --pull=always --rm --tty $(DOCKER_USER_OPT) | |
| DOCKER_RUN_FLAGS ?= --pull=newer --rm --tty $(DOCKER_USER_OPT) |
With podman this does the trick. It does take a bit of time to timeout the check in the Brandenburg case.
But maybe the best would be to just allow users to overwrite this via environment variable, e.g. by setting RIOT_DOCKER_PULL_POLICY or whatever.
There was a problem hiding this comment.
Unfortunately this flag is not available for docker: https://docs.docker.com/reference/cli/docker/container/run/#pull
I've tried adding it and it will just be silently ignored (i.e., the docker image is not updated).
There was a problem hiding this comment.
So we could have different defaults for docker (--pull=always) and podman (--pull=newer) and have DOCKER_SKIP_PULL to disable pulling altogether?
|
Doesn't this touch the network every time, taking time and possibly failing when in trains? I would definitely want to disable this. |
|
I think it would make more sense to fix thix first in riotdocker by tagging & building semver releases, then pin a semver compatible release in the RIOT branch. and then, only pull if the current release is not semver-compatible. or, just bail out in that case, as it wouldn't happen too often. |
Agreed. But who is going to do that? This would fix problems people are having right now. (Two people reported issues caused by an outdated docker container just within the last 7 days, likely this is frequent.) And with the Let's go with the |
|
OK, since How about pinning the docker image instead to a list of known good versions: #20472 |
this is probably not the solution we want -> make this a little less green
|
Can this be a draft? |
|
Obsolete since #20472 has been merged. |
Contribution description
On current master,
BUILD_IN_DOCKERmight fail just because the local docker image is outdated. Since the image is automatically pulled upon the first build with docker, users (including me) probably would expect RIOT to keep the image updated automatically.This PR changes the
docker run --pullargument from the defaultmissingtoalways.Testing procedure
BUILD_IN_DOCKER=1 make -C examples/hello-world allBUILD_IN_DOCKER=1 make -C examples/hello-world allIssues/PRs references
Issue was discussed on matrix, where @maribu proposed to automatically pull on each build.