Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose does not respect new image version #9276

Closed
benedikt-bartscher opened this issue Mar 11, 2022 · 4 comments
Closed

docker-compose does not respect new image version #9276

benedikt-bartscher opened this issue Mar 11, 2022 · 4 comments

Comments

@benedikt-bartscher
Copy link

Description
Since docker-compose v2.3.0 docker-compose does not detect newer images within the same image tag. With docker-compose v2.2.3 and lower this issue is not reproduceable. I suspect this PR: #9214

My example is for locally build images, cause it's easy to reproduce. But the same applies for images with the same tag pulled from remote docker registrys.

Steps to reproduce the issue:

  1. Create a Dockerfile with a service build locally (for example build: .)
  2. Run docker-compose build && docker-compose up -d
  3. Make some changes to your Dockerfile and run docker-compose build && docker-compose up -d again

Describe the results you received:
Containers are not recreating and keep using the old image. This can be checked with docker ps and docker image ls. The new image with the new digest is pulled correctly but not used.

Describe the results you expected:
Compose should recognize the new image with different digest and start recreating containers with the new image.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version 2.3.3

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1-docker)
  compose: Docker Compose (Docker Inc., 2.3.3)

Server:
 Containers: 12
  Running: 12
  Paused: 0
  Stopped: 0
 Images: 19
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10f428dac7cec44c864e1b830a4623af27a9fc70.m
 runc version: v1.1.0-0-g067aaf85
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.16.13-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 32
 Total Memory: 62.71GiB
 Name: ******
 ID: ***************
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false


Additional environment details:

@macmoritz
Copy link

+1

@rfay
Copy link
Contributor

rfay commented Mar 12, 2022

It also seems not to detect a changed Dockerfile, for example.

@rfay
Copy link
Contributor

rfay commented Mar 12, 2022

It seems that docker-compose up does not recreate a container if a build Dockerfile has changed, whereas in most of the history of docker-compose it has caught that on docker-compose up and done a "recreate"

@benedikt-bartscher does your situation get resolved with a docker-compose down && docker-compose up ?

@ndeloof
Copy link
Contributor

ndeloof commented Mar 13, 2022

This has been fixed by #9261

@ndeloof ndeloof closed this as completed Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants