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

When commiting an image with changes the running container also changes #29547

Closed
rmb938 opened this issue Dec 19, 2016 · 1 comment
Closed
Assignees
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. version/1.12

Comments

@rmb938
Copy link
Contributor

rmb938 commented Dec 19, 2016

Description

When commiting an image with changes (ie labels) the running container's labels are also changed.

Steps to reproduce the issue:

  1. docker run -d --label some=label centos:7
  2. docker commit --change "LABEL some=label2" ${c_id} my/image
  3. docker inspect ${c_id}

Describe the results you received:

The running container's labels are also changed.

Describe the results you expected:

The running container does not change.

Output of docker version:

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.4
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   1564f02
 Built:        Tue Dec 13 02:47:26 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 28
 Running: 26
 Paused: 0
 Stopped: 2
Images: 30
Server Version: 1.12.4
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 404
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.38-boot2docker
Operating System: Boot2Docker 1.12.4 (TCL 7.2); HEAD : d0b8fd8 - Tue Dec 13 18:21:26 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.858 GiB
Name: bats
ID: 2FFF:SLRA:BJOP:L6Z2:2UQU:VR3J:DGJ2:UOFR:SH27:UCW4:I26R:PKFJ
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 215
 Goroutines: 177
 System Time: 2016-12-19T16:31:03.949019346Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
Insecure Registries:
 127.0.0.0/8
@cpuguy83 cpuguy83 added the kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. label Dec 19, 2016
@cpuguy83
Copy link
Member

Confirmed

@LK4D4 LK4D4 self-assigned this Dec 19, 2016
xianlubird pushed a commit to xianlubird/docker that referenced this issue Dec 23, 2016
Fix moby#29547

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
vdemeester pushed a commit to vieux/docker that referenced this issue Jan 4, 2017
Fix moby#29547

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ca6c6f0)
Signed-off-by: Victor Vieux <vieux@docker.com>
runcom pushed a commit to projectatomic/docker that referenced this issue May 12, 2017
Fix moby#29547
Fix https://bugzilla.redhat.com/show_bug.cgi?id=1450221
Upstream reference:
moby@428ae70

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ca6c6f0)
Signed-off-by: Victor Vieux <vieux@docker.com>
liusdu pushed a commit to liusdu/moby that referenced this issue Oct 30, 2017
Fix moby#29547

Cherry-pick from moby#29550

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: majiuyue 00385406 <majiuyue@huawei.com>
liusdu pushed a commit to liusdu/moby that referenced this issue Oct 30, 2017
[IT-1.11.2] Do not change container labels on commit

**Issue** upstream moby#29547

 moby#29547

**Description**

When commiting an image with changes (ie labels) the running container's labels are also changed.

**Steps to reproduce the issue:**

```
docker run -d --label some=label centos:7
docker commit --change "LABEL some=label2" ${c_id} my/image
docker inspect ${c_id}
```

----

Cherry-pick from moby#29550


See merge request docker/docker!305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. version/1.12
Projects
None yet
Development

No branches or pull requests

4 participants