Instalasi Docker pada Debian Jessie 8.x¶
Pengaturan awal server¶
Lihat skrip praDebian8.sh
# Purge any older repositories
sudo apt-get purge "lxc-docker*"
sudo apt-get purge "docker.io*"
# Update package information, ensure that APT works with the https method, and that CA certificates are installed
sudo apt install -y apt-transport-https ca-certificates gnupg2
# Add the new GPG key.
sudo apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# Add an entry for your Debian operating system.
#nano /etc/apt/sources.list.d/docker.list
#deb https://apt.dockerproject.org/repo debian-jessie main
sudo -i echo 'deb https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list
# Update the APT package index
sudo apt update
# Verify that APT is pulling from the right repository
sudo apt-cache policy docker-engine
# Install Docker
sudo apt install -y docker-engine
# Start the Docker daemon
sudo service docker start
# Verify docker is installed correctly
sudo docker run hello-world
Giving non-root access¶
Login sebagai pengguna deploy
, lalu jalankan perintah-perintah di bawah
# Add the docker group if it doesn't already exist.
# sudo groupadd docker
# Add the connected user "${USER}" to the docker group.
# Change the user name to match your preferred user.
sudo gpasswd -a ${USER} docker
# You may have to logout and log back in again for
# this to take effect.
# Restart the Docker daemon.
sudo service docker restart
Upgrade Docker¶
sudo apt-get upgrade docker-engine
Uninstall Docker¶
# To uninstall the Docker package
sudo apt-get purge docker-engine
# To uninstall the Docker package and dependencies that are no longer needed
sudo apt-get autoremove --purge docker-engine
# The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following command
sudo rm -rf /var/lib/docker
Rujukan: