--Installation - docker - docker-compose --Docker data Move the save destination directory
Install docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
#Docker after installation-If the compose command fails, check the path
#Also in the path/usr/Create symbolic links to bins and other directories, etc.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
no sudo
--Make it executable without sudo
sudo groupadd docker
sudo gpasswd -a $USER docker
#Add to the end of the file. -Specify the docker data save destination directory after g
OPTIONS="-g /opt/docker"
#option file read
EnvironmentFile=/etc/default/docker
#At the end of the ExecStart line$Added OPTIONS
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $OPTIONS
sudo systemctl daemon-reload
sudo systemctl restart docker
https://docs.docker.com/engine/install/ https://mebee.info/2020/04/13/post-8593/ https://www.codeflow.site/ja/article/how-to-install-and-use-docker-on-debian-10 https://qiita.com/DQNEO/items/da5df074c48b012152ee
Recommended Posts