docker

You are currently browsing articles tagged docker.

安装参考

https://github.com/portainer/portainer
https://documentation.portainer.io/quickstart/
https://documentation.portainer.io/v2.0/deploy/ceinstalldocker/

Linux 主机安装示例如下:

[root@localhost ~]# docker volume create portainer_data
portainer_data
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Unable to find image 'portainer/portainer-ce:latest' locally
latest: Pulling from portainer/portainer-ce
94cfa856b2b1: Pull complete 
49d59ee0881a: Pull complete 
3fc1bc38fb56: Pull complete 
Digest: sha256:f133bfdd9646f48a8ddb54b9555070f628caa530924045eeff8144a32de2dcc7
Status: Downloaded newer image for portainer/portainer-ce:latest
f4bf3f5fe82d1e15aff223752b10b987f298ebdea5a987c6303d38dc6c4079d3

安装完成后, 访问9000端口, 第一次登录会让你配置用户名/密码, 之后选择Docker–> Local.

Read the rest of this entry »

Tags:

Docker 容器相关操作

#docker container run -d nginx
#docker container run -ti ubuntu  <<< 安全退出 Ctrl+P && Ctrl+Q
#docker container attach <CONTAINER ID>
#docker container exec -it <CONTAINER ID>
#docker ps -l //查看最新创建的容器
#docker ps -q //查看容器ID
#docker ps -a //查看所有容器, 包括已经停止的
#docker logs <CONTAINER ID>    //查看log
#docker container stop  //发送TERN信号等待10s后, 如果容器没停止发送KILL信号
#docker container kill  //发送KILL信号,容器立刻停止
#docker container rm    //删除已停止的容器, --force 强制删除
#docker container rm $(docker ps -aq) --force

#docker container inspect <CONTAINER ID>  //会打印出容器的详细信息
#docker container diff <CONTAINER ID>  //查看容器

#docker run -it busybox 

//容器之间共享namespace

#docker container run –d --name infra --ipc=shareable google/pause
#docker container run –tid --name busybox01 \
--pid=container:infra \
--ipc=container:infra \
--net=container:infra busybox
#docker container run –tid --name busybox02 \
--pid=container:infra \
--ipc=container:infra \
--net=container:infra busybox
Read the rest of this entry »

Tags:

Reference:
Linux网络 - 数据包的接收过程
Linux网络 - 数据包的发送过程
Linux虚拟网络设备之tun/tap
Linux虚拟网络设备之veth

Read the rest of this entry »

Tags:

Reference:
https://docs.docker.com/engine/install/centos/
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
https://www.runoob.com/docker/docker-tutorial.html
Centos Docker install
[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
[root@localhost ~]# sudo yum-config-manager --enable docker-ce-nightly
[root@localhost ~]# sudo yum-config-manager --enable docker-ce-test
[root@localhost ~]# yum install docker-ce docker-ce-cli containerd.io
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl status docker
[root@localhost ~]# docker info
[root@localhost ~]# docker run hello-world
HTTP/HTTPS proxy
[root@localhost ~]#sudo mkdir -p /etc/systemd/system/docker.service.d
[root@localhost ~]#vi /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://xxx:80"
Environment="HTTPS_PROXY=http://xxx:80"
Environment="NO_PROXY=localhost,127.0.0.1,.cisco.com"
[root@localhost ~]#sudo systemctl daemon-reload
[root@localhost ~]#sudo systemctl restart docker
[root@localhost ~]#sudo systemctl show --property=Environment docker
[root@localhost ~]#docker run hello-world
Read the rest of this entry »

Tags: