[BUG] docker inline config when changed is not being taken into account #11900
Open
Description
Description
On change of inline config in yaml, I'm not getting the new content on rerun. I need an explicit option --force-recreate
or to do a docker compose down
to get the new content. I expect the behavior to be similar to an env variable change that is taken into account on change and make container restart on docker compose up
Steps To Reproduce
How to reproduce:
- create following docker-compose.yaml
name: config-inline
services:
service:
image: ubuntu
entrypoint: cat
command: /path/to/config.txt
configs:
- source: config.txt
target: /path/to/config.txt
configs:
config.txt:
content: |
foo bar 1
docker compose up
- change config.txt content in the yaml to foo bar 2
- rerun
docker compose up
Output command 5:
# docker compose up
[+] Running 1/0
✔ Container config-inline-service-1 Created 0.0s
Attaching to service-1
service-1 | foo bar 1
service-1 exited with code 0
Expected output:
d1c6f75f97dd:/khaled# docker compose up
[+] Running 1/0
✔ Container config-inline-service-1 Created 0.0s
Attaching to service-1
service-1 | foo bar 2
service-1 exited with code 0
Compose Version
Docker Compose version v2.23.3
Docker Environment
Client:
Version: 25.0.5
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc.)
Version: v2.23.3
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 97
Running: 14
Paused: 0
Stopped: 83
Images: 64
Server Version: 23.0.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
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: active
NodeID: cz1gqp5o4uw6ppyics6xn6a2k
Is Manager: true
ClusterID: y0c9rhn8fl7p14avdgifzoctz
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Data Path Port: 4789
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 91.92.200.132
Manager Addresses:
91.92.200.132:2377
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.2.0-20-generic
Operating System: Ubuntu 23.04
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.736GiB
Name: khaled-dev
ID: fabc09a1-5d59-479f-b8c7-9983afae8e1c
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Anything else?
No response