docker(ce) on Ubuntu

2567 단어

Note:
# - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

 
 
1. install
$sudo apt install docker.io

 
2. enable
$ sudo systemctl start docker
$ sudo systemctl enable docker

 
 test:
$ docker --version

 
 
 
2. Docker compose
1. down
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

 
2. exec
sudo chmod +x /usr/local/bin/docker-compose

 
test
tdtc@tdtc306:~$ docker-compose --version
docker-compose version 1.24.1, build 4667896b

 
other command
 
    1. 이미지 정리
sudo docker system prune -a

 
    2. 이미지 관리
1)ps
sudo dokcer ps

2) 컨테이너 입장
fat shell:
sudo docker exec -it  bash

simple shell:
sudo docker exec -it  sh

 
 
3) 컨테이너 내 실행
보기
cat Gopkg.toml |more

편집자
apt-get update
apt-get install vim -y vi Gopkg.toml

 
 4) stop all containers
sudo docker stop $(sudo docker ps -q)

 
 
 
Reference:
    1. How to Install Docker On Ubuntu 18.04 Bionic Beaver
    2. Install Docker Compose(Offical)
    3. How do I get into a Docker container's shell?

좋은 웹페이지 즐겨찾기