Skip to content

Latest commit

 

History

History
59 lines (55 loc) · 1.75 KB

File metadata and controls

59 lines (55 loc) · 1.75 KB


Installing Docker

Update list of package:

sudo apt update

Install prerequisite package:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Add repository:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add docker to apt:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

Update list of package:

sudo apt update

Make sure:

apt-cache policy docker-ce

Install docker:

sudo apt install docker-ce

Check status:

sudo systemctl status docker

Execute docker without sudo

sudo usermod -aG docker ${USER}
su - ${USER}
id -nG
sudo usermod -aG docker [USERNAME]

Manage Docker

menghapus image

docker image rm haqiramadhani/wamt

membuat image

docker build -t haqiramadhani/wamt .

publish docker image to registry

docker push haqiramadhani/wamt:latest

download image from registry

docker pull haqiramadhani/wamt:latest

create container from image

docker container create --name wamt6285311160970 -p 80:8080 -e PORT=8080 haqiramadhani/wamt:latest

start container

docker container start wamt6285311160970

check memory usage of container

docker ps -q | xargs docker stats --no-stream