Kylinos-server (Sword) Deploy
kylinos-server(兆芯版) for Ubuntu 64
Login account
Checked OS
1 2 3
| $ cat /etc/kylin-release
$ uname -p
|
View docker stable website
Docker list
Install
1
| $ wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz
|
noted: if using offline installation, ignore the above install steps
Setting docker
1 2 3
| $ tar -zxvf docker-20.10.9.tgz
$ mv docker/* /usr/bin
|
- Create docker.service conf
1
| $ vi /usr/lib/systemd/system/docker.service
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
|
1
| $ chmod +x /usr/lib/systemd/system/docker.service
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| $ sudo mkdir -p /etc/docker $ sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": [ "http://f1361db2.m.daocloud.io", "https://7bnhbpem.mirror.aliyuncs.com", "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn", "https://mirror.ccs.tencentyun.com", "https://ung2thfc.mirror.aliyuncs.com", "https://reg-mirror.qiniu.com" ] } EOF
|
1 2 3 4 5 6
| $ firewall-cmd --query-masquerade $ sysctl -p $ vi /etc/sysctl.conf $ firewall-cmd --add-masquerade --permanent $ firewall-cmd --permanent --add-port=22/tcp $ firewall --reload
|
1 2 3 4
| $ sudo systemctl daemon-reload $ sudo systemctl start docker $ sudo systemctl enable docker.service $ sudo systemctl restart docker
|
- Docker operation commands
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| $ touch ~/.vimrc && vi ~/.vimrc :set encoding=utf-8
$ docker network create --driver bridge --subnet 172.18.0.1/24 --gateway 172.18.0.1 poc_net
$ docker load --input [imageName.tar]
$ docker run --name [containerId] -itd [imagaeId|repository:tag]
$ docker exec -it [containerId] /bin/bash
$ docker tag [imageId] [reposity:tag]
$ docker stop $(docker ps -a -q)
$ docker container prune
$ docker rmi -f [imageId|repository:tag]
$ docker logs --since 30m 62db69ff44b9
|