Home - HaymonEdmur/DockerConfiguration GitHub Wiki
Welcome to the DockerConfiguration wiki!
Installation:
Access Docker website and download only the binaries for Linux. This binary will be a compressed tar file. Extract this to
/usr/local/sbin
directory
Docker Daemon Configuration file: Default location /etc/docker/daemon.json Other file location can be specified by --config-file option
/etc/docker/daemon.json
{
"pidfile" : "/var/run/docker.pid",
"storage-driver" : "overlay2",
# On unbuntu 17
"graph" : "/var/DockerData"
# On CentOS 7
"data-root" : "/var/DockerData",
"hosts" : ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}
Parameter | Description |
---|---|
pidfile | dockerd daemon process id file |
storage-driver | File System. Default is aufs. overlay2 is the latest which improves performance |
data-root | Locally pulled images, volumes and related configuration storage for docker daemon default /var/lib/docker |
Systemd configurationn
Add /usr/lib/systemd/system/docker.service
[Unit]
Description=Hemant's Docker daemon
Requires=docker.socket
After=network.target
[Service]
Type=simple
WorkingDirectory=/tmp
Environment=PATH=/bin:/usr/sbin:/sbin:/var/DockerData/bin
ExecStart=/usr/local/sbin/dockerd
[Install]
WantedBy=multi-user.target
Add /usr/lib/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
#SocketGroup=docker ( use this group if required )
[Install]
WantedBy=sockets.target