Daftar Command Docker yang Sering digunakan

Berikut adalah command yang sering digunakan dalam Docker

check version

docker -v

show image docker

docker image ls

show image docker

docker image ls

download docker image from web

docker image pull image:tag

remove docker image

docker image rm image:tag

show all container

docker container ls -a

create docker container

docker container create --name namacontainer namaimage:tag

run container

docker container start containerId/namacontainer

stop container

docker container stop containerId/namacontainer

remove container

docker container rm containerId/namacontainer

show logs container

docker container logs containerId/namacontainer

real time logs container

docker container logs -f containerId/namacontainer

login to container

docker container exec -i -t containerId/namacontainer /bin/bash

port forwarding container

docker container create --name namacontainer --publish porthost:portcontainer image:tag

add environment variable

docker container create --name namacontainer --publish porthost:portcontainer --env KEY1=value KEY2=value image:tag

view stats container

docker container stats

container resource limit

docker container create --name namacontainer --memory 100m namaimage:tag

container CPU limit

docker container create --name namacontainer --cpus 1.5 namaimage:tag

sharing file container

docker container create --name namacontainer --mount type=bind,source=folder,destination=folder,readonly” namaimage:tag

Posting Komentar

0 Komentar