{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/29263","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/29263/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/29263/comments","events_url":"https://api.github.com/repos/docker/docker/issues/29263/events","html_url":"https://github.com/docker/docker/issues/29263","id":194482971,"number":29263,"title":"Image contents inconsistency if used by > 1 containers over overlay2","user":{"login":"onorua","id":407040,"avatar_url":"https://avatars.githubusercontent.com/u/407040?v=3","gravatar_id":"","url":"https://api.github.com/users/onorua","html_url":"https://github.com/onorua","followers_url":"https://api.github.com/users/onorua/followers","following_url":"https://api.github.com/users/onorua/following{/other_user}","gists_url":"https://api.github.com/users/onorua/gists{/gist_id}","starred_url":"https://api.github.com/users/onorua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onorua/subscriptions","organizations_url":"https://api.github.com/users/onorua/orgs","repos_url":"https://api.github.com/users/onorua/repos","events_url":"https://api.github.com/users/onorua/events{/privacy}","received_events_url":"https://api.github.com/users/onorua/received_events","type":"User","site_admin":false},"labels":[{"id":73635104,"url":"https://api.github.com/repos/docker/docker/labels/area/distribution","name":"area/distribution","color":"fbca04","default":false},{"id":375714123,"url":"https://api.github.com/repos/docker/docker/labels/version/1.12","name":"version/1.12","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-09T00:31:31Z","updated_at":"2016-12-09T00:31:31Z","closed_at":null,"body":"**Description**\r\n\r\nWe have noticed, that in case we have more than 1 container is using image, when ever we do update, image data is not updated until we remove containers manually. Even though, they were removed by docker-compose during update procedure. \r\n\r\n```\r\nroot@bhss-fra3-prod-26:~# docker pull anchorfree/ar-php-fpm:blue\r\nblue: Pulling from anchorfree/ar-php-fpm\r\nDigest: sha256:1515c38254bc8ac0e5cebafbbca7a99c4299134a1a3aab8571324e19ecc6b809\r\nStatus: Image is up to date for anchorfree/ar-php-fpm:blue\r\n\r\nroot@bhss-fra3-prod-26:~# docker ps\r\nCONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS              PORTS                      NAMES\r\ne2ba6c990f24        anchorfree/bhss-nginx:blue        \"entrypoint.sh\"          12 seconds ago      Up 11 seconds                                  bhss-nginx\r\nf639ea17ea01        anchorfree/ar-php-fpm:blue        \"/entrypoint.sh\"         15 seconds ago      Up 11 seconds                                  php-fpm-hsselite\r\ncd2465f78813        anchorfree/ar-php-fpm:blue        \"/entrypoint.sh\"         15 seconds ago      Up 13 seconds                                  php-fpm-www\r\n05fa354046b4        anchorfree/ar-php-fpm:blue        \"/entrypoint.sh\"         15 seconds ago      Up 13 seconds                                  php-fpm-hss\r\n312936e11c45        anchorfree/ar-php-fpm:blue        \"/entrypoint.sh\"         16 seconds ago      Up 11 seconds                                  php-fpm-rss2search\r\n03a59031a273        anchorfree/ar-php-fpm:blue        \"/entrypoint.sh\"         16 seconds ago      Up 12 seconds                                  php-fpm-deliverycurl\r\n...\r\n```\r\nso the image is up to date, containers restarted, everything is fine. \r\n```\r\nroot@bhss-fra3-prod-26:~# docker exec -i -t php-fpm-www shasum /var/www/hss.hotspotshield.com/classes/SdBuilder/Android.php\r\n65f31d4e52528e46e5b7d420cd4e4a938c5601d9  /var/www/hss.hotspotshield.com/classes/SdBuilder/Android.php\r\n```\r\ncheckusm is from the old image, lets delete all containers which use the image:\r\n```\r\nroot@bhss-fra3-prod-26:~# docker rm -f php-fpm-hsselite  php-fpm-www php-fpm-hss php-fpm-rss2search php-fpm-deliverycurl\r\nphp-fpm-hsselite\r\nphp-fpm-www\r\nphp-fpm-hss\r\nphp-fpm-rss2search\r\nphp-fpm-deliverycurl\r\n```\r\nthen start up containers:\r\n```\r\nroot@bhss-fra3-prod-26:~# compose-updater.sh run\r\nskipping pull state\r\n...\r\nCreating php-fpm-www\r\nCreating php-fpm-rss2search\r\nCreating php-fpm-deliverycurl\r\nCreating php-fpm-hsselite\r\nRecreating bhss-nginx\r\n```\r\nand final check:\r\n```\r\nroot@bhss-fra3-prod-26:~# docker exec -i -t php-fpm-www shasum /var/www/hss.hotspotshield.com/classes/SdBuilder/Android.php\r\n13f23ff665b2dd37f9d2ad9a6d2502189a7a173b  /var/www/hss.hotspotshield.com/classes/SdBuilder/Android.php\r\n```\r\nchecksum is different completely. \r\n\r\ncompose-updater is the script which is wrapping the compose -f files:\r\n```\r\n#!/usr/bin/env bash\r\n\r\ncompose=\"/usr/local/bin/docker-compose \"\r\n\r\ninclude () {\r\n    [[ -f \"$1\" ]] && source \"$1\"\r\n}\r\n\r\nfor i in $( ls -1 ${COMPOSE_FILES:-/etc/docker-compose/*.yml}); do\r\n    compose+=( -f \"${i}\" )\r\ndone\r\n\r\n# make sure we always have the latest image\r\nif [[ $1 = 'run' ]]; then\r\n    echo \"skipping pull state\"\r\nelse\r\n/usr/bin/flock -en -x /tmp/compose-pull.lock ${compose[@]} pull\r\nfi\r\n\r\n# start it all up\r\nif [[ $1 = 'pull' ]]; then\r\n    echo \"skipping up state\"\r\nelse\r\n/usr/bin/flock -en -x /tmp/compose-up.lock ${compose[@]} up -d --remove-orphans\r\nfi\r\n\r\n# images cleanup\r\nif [[ $(docker images -q --filter \"dangling=true\") ]]; then\r\n    docker rmi $(docker images -q --filter \"dangling=true\")\r\nfi\r\n```\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\ndocker version\r\nClient:\r\n Version:      1.12.3\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   6b644ec\r\n Built:        Wed Oct 26 22:01:48 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.12.3\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   6b644ec\r\n Built:        Wed Oct 26 22:01:48 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\ndocker info\r\nContainers: 31\r\n Running: 31\r\n Paused: 0\r\n Stopped: 0\r\nImages: 24\r\nServer Version: 1.12.3\r\nStorage Driver: overlay2\r\n Backing Filesystem: extfs\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: bridge null host overlay\r\nSwarm: inactive\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nSecurity Options: apparmor seccomp\r\nKernel Version: 4.4.0-47-generic\r\nOperating System: Ubuntu 16.04.1 LTS\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 4\r\nTotal Memory: 7.796 GiB\r\nName: bhss-fra3-prod-26\r\nID: LUK6:655X:4ES3:IMWZ:PIGX:R2VP:TYPR:DN6U:2K67:7YMV:3PIK:PGPP\r\nDocker Root Dir: /var/lib/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): false\r\nUsername: afprod\r\nRegistry: https://index.docker.io/v1/\r\nWARNING: No swap limit support\r\nInsecure Registries:\r\n 127.0.0.0/8\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\nIt is running on DigitalOcean boxes"}}
{"actor":{"display_login":"onorua"}}