moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.5k stars 18.63k forks source link

YUM update clobbers my docker.service file #22062

Closed mysqlboy closed 8 years ago

mysqlboy commented 8 years ago

In my excitement I've moved to upgrade to 1.11.0 on my CentOS7 node and after the packages from the docker repo had successfully installed I find my docker.service unit file has been overwritten. What a PITA. Is there some way to package docker-engine so that it can make a backup of the existing docker.service unit file before writing the default?

I've got backups so not biggie, but the behaviour might be tuned.

Output of docker version:

Client:
 Version:      1.11.0
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   4dc5990
 Built:        Wed Apr 13 18:40:36 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.0
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   4dc5990
 Built:        Wed Apr 13 18:40:36 2016
 OS/Arch:      linux/amd64

Output of docker info:

[moore@randy ~]$ docker info
Containers: 27
 Running: 2
 Paused: 0
 Stopped: 25
Images: 27
Server Version: 1.11.0
Storage Driver: overlay
 Backing Filesystem: xfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: overlay bridge null host
Kernel Version: 3.10.0-327.10.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 31.06 GiB
Name: randy.mysqlboy.com
ID: 4Q5A:QNQM:NPKU:BZX4:RI4P:2K6X:RWCQ:SDOU:GV4J:D3TO:FTI4:2U3Q
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Username: mysqlboy
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-ip6tables is disabled
Labels:
 com.mysqlboy.environment=production
 com.mysqlboy.storage=ssd
 com.mysqlboy.role=db
 com.mysqlboy.location=primary
Cluster store: consul://192.168.88.177:8500
Cluster advertise: 192.168.88.177:2375

Additional environment details (AWS, VirtualBox, physical, etc.): Physical, on premise hardware

Steps to reproduce the issue:

  1. Customise /usr/lib/systemd/system/docker.service
  2. yum install docker-engine
  3. observe service failure or change in behaviour depending on your customisations in 1)

Describe the results you received: Default unit file clobbered my customised one

Describe the results you expected: unit file backed up or retained because it's not the default

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

cpuguy83 commented 8 years ago

You should not change the provided docker.service file directly. Instead systemd supports "drop-ins", which is basically an override unit file. https://docs.docker.com/engine/admin/systemd/#custom-docker-daemon-options

mysqlboy commented 8 years ago

Thanks, read the F manual. Appreciate the response.