Last month the main thing was to migrate svn back locally and write the related processing scripts, then install the deployment docker, install the Docker on the local server, deploy the environment for testing, rewrite some release scripts, and start the script. The following are the installation steps for Docker:
Installation steps on Ubuntu server:
1.0## #配置docker. List:
Sh-c "Echo Deb Https://get.docker.io/ubuntu Docker main >/etc/apt/sources.list.d/docker.list"
2.0## #下载公钥:
Curl-s HTTPS://GET.DOCKER.IO/GPG | sudo apt-key add-
3.0## #没公钥就自己配置:
Apt-key adv--keyserver hkp://keyserver.ubuntu.com:80--recv-keys d8576a8ba88d21e9
4.0## #更新apt源:
Apt-get Update
5.0## #下载安装docker和以及一些必需的软件包:
Apt-get Install Lxc-docker-y
6.0## #检查
Docker info
The following is the underlying operation command:
# # #查找centos镜像:
Docker Search CentOS
# # #查看以下载的镜像:
Docker images
# # #启动一个centos系统的容器并命名为docker-ceshi. Where-I interactive mode,-t pseudo terminal,-D background run:
Docker RUN-ITD--name Docker-ceshi Centos/bin/bash
# # #查看正在运行的和停止的容器:
Docker Ps-a
# # #查看刚生成的容器
Docker Ps-l
# # #进入刚生成的容器docker-ceshi, for example enter Ceshi, command as follows:
Docker-enter Docker-ceshi
To exit the container, enter exit directly.
# # # #其中进入容器是使用docker The-enter command, the script is as follows:
#!/bin/sh
If [-E $ (dirname "$")/nsenter]; Then
# with Boot2docker, Nsenter isn't in the PATH but it's in the same folder
nsenter=$ (dirname "$")/nsenter
Else
Nsenter=nsenter
Fi
If [-Z ']; Then
echo "Usage: ' basename" $ "CONTAINER [COMMAND [ARG] ...]"
echo ""
echo "enters the Docker CONTAINER and executes the specified COMMAND."
echo "If COMMAND is not specified, runs a interactive shell in CONTAINER."
Else
pid=$ (Docker inspect--format "{{. State.pid}} "" $ ")
If [-Z "$PID"]; Then
Exit 1
Fi
Shift
opts= "--target $PID--mount--uts--ipc--net--pid--"
If [-Z ']; Then
# No Command given.
# Use SU to clear all host environment variables except for term,
# Initialize the environment variables HOME, SHELL, USER, LOGNAME, PATH,
# and start a login shell.
"$NSENTER" $OPTS su-root
Else
# Use the env to clear all host environment variables.
"$NSENTER" $OPTS env--ignore-environment--"[email protected]"
Fi
Fi
##################End#################################
to do a port mapping for a container:
Docker run-itd--name ceshi1-p 1000:80 Centos/bin/bash
The native Docker primary server IP is: 192.168.0.168, to access the port of CESHI1 80, the following interface appears to indicate normal access:
650) this.width=650; "class=" Confluence-embedded-image "src=" http://wiki.qydw.net/download/attachments/12223144/ 1000.jpg?version=1&modificationdate=1460346412000&api=v2 "alt=" 1000.jpg?version=1&modificationdate= 1460 "/>
This article from the "Early bird has worms to eat" blog, declined reprint!
Docker (i): Installation deployment