Difference between revisions of "Docker: Instalasi di Ubuntu 18.04"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "==Instalasi== curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubunt...") |
Onnowpurbo (talk | contribs) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Instalasi== | ==Instalasi== | ||
+ | apt install curl | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
Line 6: | Line 7: | ||
apt-cache policy docker-ce | apt-cache policy docker-ce | ||
+ | sudo apt install -y docker-ce | ||
+ | sudo systemctl status docker | ||
+ | |||
+ | Pastikan status docker running | ||
+ | |||
+ | |||
+ | ==Membuat agar tidak perlu sudo lagi== | ||
+ | |||
+ | |||
+ | sudo usermod -aG docker ${USER} | ||
+ | su - ${USER} | ||
+ | id -nG | ||
+ | |||
+ | Atau secara explisit menambahkan username ke group docker | ||
+ | |||
+ | sudo usermod -aG docker username | ||
+ | |||
+ | |||
+ | ==Perintah Docker== | ||
+ | |||
+ | docker [option] [command] [arguments] | ||
+ | docker | ||
+ | docker docker-subcommand --help | ||
+ | docker info | ||
+ | |||
+ | ==Menggunakan Docker Image== | ||
+ | |||
+ | sudo docker run hello-world | ||
+ | sudo docker search ubuntu | ||
+ | sudo docker pull ubuntu | ||
+ | sudo docker run ubuntu | ||
+ | sudo docker images | ||
+ | |||
+ | ==Run Docker Container== | ||
+ | |||
+ | Tambahkan -it untuk interactive shell access | ||
+ | |||
+ | sudo docker run -it ubuntu | ||
+ | |||
+ | |||
+ | ==Managing Docker== | ||
+ | |||
+ | sudo docker ps | ||
+ | sudo docker ps -a | ||
+ | sudo docker ps -l | ||
+ | sudo docker start 9b0db8a30ad1 (9b0db8a30ad1 adalah container-id) | ||
+ | sudo docker stop xenodochial_neumann | ||
+ | sudo docker rm youthful_roentgen | ||
==Pranala Menarik== | ==Pranala Menarik== | ||
* [[Docker]] | * [[Docker]] |
Latest revision as of 10:06, 6 December 2018
Instalasi
apt install curl curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt update apt-cache policy docker-ce
sudo apt install -y docker-ce sudo systemctl status docker
Pastikan status docker running
Membuat agar tidak perlu sudo lagi
sudo usermod -aG docker ${USER} su - ${USER} id -nG
Atau secara explisit menambahkan username ke group docker
sudo usermod -aG docker username
Perintah Docker
docker [option] [command] [arguments] docker docker docker-subcommand --help docker info
Menggunakan Docker Image
sudo docker run hello-world sudo docker search ubuntu sudo docker pull ubuntu sudo docker run ubuntu sudo docker images
Run Docker Container
Tambahkan -it untuk interactive shell access
sudo docker run -it ubuntu
Managing Docker
sudo docker ps sudo docker ps -a sudo docker ps -l sudo docker start 9b0db8a30ad1 (9b0db8a30ad1 adalah container-id) sudo docker stop xenodochial_neumann sudo docker rm youthful_roentgen