1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| # 安装docker.io 是ubuntu团队维护的一个包 sudo apt install docker.io
# 启动docker systemctl start docker
# Verify sudo docker run hello-world
# pull nginx image sudo docker pull nginx
# first run # create container # run container docker run
# start|stop container docker start|stop
# list container docker ps -a
# remove container docker rm
# remove image docker rmi
# rename container docker rename old_name new_name
# enter container sudo docker exec -it container_name /bin/bash
sudo docker build -t react:v1 . sudo docker images sudo docker run --name react react:v2
# 打包镜像提交到 dockerhub
docker login -u scorpionjay
docker images docker tag python_node scorpionjay/python_node docker push scorpionjay/python_node
|