[BUG] docker compose alpha watch does not recreate container with current config if config changes while command is running.
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #13858 của @maxpetrusenkoagent — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu từ điểm vào docker compose alpha watch và tái hiện hành vi với các tệp docker-compose.yaml, web.env và package.json đã được đề cập. So sánh cấu hình được sử dụng khi watch khởi động với cấu hình được sử dụng sau một thay đổi kích hoạt việc build lại. Hoàn tất khi một lần build lại được kích hoạt sử dụng cấu hình Compose và môi trường hiện tại mà không khởi động lại watch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When using the docker compose alpha watch command if you make a change to the env_files in the docker-compose.yaml or change the docker-compose.yaml file itself and let a file change trigger the rebuild functionality those changes are not used during the rebuild.
Steps To Reproduce
Working Docker Desktop
Use the following Config.
docker-compose.yaml
services:
web:
build: .
command: npm start
env_file:
- ../web.env
x-develop:
watch:
- action: rebuild
path: package.json
web.env
VALUE=1
If you do a docker compose up -d the web container will be created with VALUE=1 as an env-var.
You can then start a docker compose alpha watch to make your changes.
If you change VALUE=1 to VALUE=2 in the .env file this will not trigger a rebuild (as expected we are not watching that file) and if you do a docker-compose up -d the container will be recreated with the new value. However if you don't stop the watch and it triggers a rebuild the container will be recreated with the value at the time the docker compose alpha watch was started.
This also works if you have the watch include the .env file, the container will be recreated with whatever was in the .env file at the time of the docker compose alpha watch command was started.
If you change the config of the docker-compose.yaml file this also does not get carried over when the rebuild starts.
docker-compose.yaml
services:
web:
build: .
command: npm start
env_file:
- ../web.env
environment:
- name=value
x-develop:
watch:
- action: rebuild
path: package.json
Triggering a rebuild via the watch functionality creates a new container without the name=value env-var unless you also restart the watch command.
Expected Behavior:
The watch command should rebuild the full config of the container including any changes to configs whenever a rebuild is triggered.
When I make a change to the env file I do not expect the rebuild to trigger if I'm not including that in my watch config, however when that rebuild does happen I would expect that the most current config would be used to rebuild the container not the config that was in place when the docker compose alpha watch command was started.
Compose Version
docker compose version
Docker Compose version v2.20.2-desktop.1
Docker Environment
docker info
Client:
Version: 24.0.5
Context: desktop-linux
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2-desktop.1
Path: /Users/user/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.20.2-desktop.1
Path: /Users/user/.docker/cli-plugins/docker-compose
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.0
Path: /Users/user/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.20
Path: /Users/user/.docker/cli-plugins/docker-extension
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v0.1.0-beta.6
Path: /Users/user/.docker/cli-plugins/docker-init
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
Version: 0.6.0
Path: /Users/user/.docker/cli-plugins/docker-sbom
scan: Docker Scan (Docker Inc.)
Version: v0.26.0
Path: /Users/user/.docker/cli-plugins/docker-scan
scout: Command line tool for Docker Scout (Docker Inc.)
Version: 0.20.0
Path: /Users/user/.docker/cli-plugins/docker-scout
Server:
Containers: 12
Running: 11
Paused: 0
Stopped: 1
Images: 22
Server Version: 24.0.5
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: cgroupfs
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 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
seccomp
Profile: unconfined
cgroupns
Kernel Version: 5.15.49-linuxkit-pr
Operating System: Docker Desktop
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 7.765GiB
Name: docker-desktop
ID: 23d03acd-9f09-4984-86b9-3d25b66c3fac
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
127.0.0.0/8
Live Restore Enabled: false
Anything else?
No response
- Ngôn ngữ chính
- Go
- Star
- 38.9k
- Fork
- 6k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 81
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/compose
-
[BUG] `docker compose port` prints `:0` (exit 0) for a port the image exposes but the service does not publishCó thể đã có người làm @ndeloof đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
docker/compose#14435 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] deploy.restart_policy without condition drops the restart policyCó thể làm lại được @akshat-lakhera đã nhận 25 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
docker/compose#14383 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] up: an optional (required: false) service_healthy dependent is not started when a required dependent shares the failing waitCó thể đã có người làm @ndeloof đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
docker/compose#14507 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Negative replica count in scale flags (docker compose scale / --scale) is accepted without validationCó thể đã có người làm @arsalanyavari đã nhận 8 ngày trước. Đang mởkind/bug status/approved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/compose
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
fluxcd/notification-controller#1441 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
volcengine/volcengine-go-sdk#163 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OneBusAway/maglev#2145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority/medium status/ready type/chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
discobox-ai/discobox#1357 ·
Maintainer thường phản hồi trong vòng 1 ngày