CMD centos7 安装 最新版本的docker ENTRYPOINT - 导入镜像 save tar mariadb Dockerfile 构建镜像

cd /wxqyh/soft/micro
tar -xvf docker-19.03.8.tgz
cp docker/* /usr/bin/

----------------------------
echo '[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
# TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target' > /etc/systemd/system/docker.service

---------------------------------
mkdir -p /etc/docker
echo '{
  "registry-mirrors": ["https://72idtxd8.mirror.aliyuncs.com"],
  "log-driver":"json-file",
  "log-opts": {"max-size":"1024m", "max-file":"3"}
}' > /etc/docker/daemon.json

---------------------------------
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service

 




sudo systemctl daemon-reload
sudo systemctl restart docker
https://dev.aliyun.com/list.html 寻找镜像

Dockerfile 原语里面ENTRYPOINT 是docker的启动进程,CMD是ENTRYPOINT的参数
#########################################################################
mariadb Dockerfile
在mysql官方镜像中提供了容器启动时自动执行/docker-entrypoint-initdb.d文件夹下的脚本的功能(包括shell脚本和sql脚本) 
也就是说只要把你自己的初始化脚本放到/docker-entrypoint-initdb.d/文件夹下就齐活了。
参考:https://blog.csdn.net/10km/article/details/79046864

概念:--link selenium_hub:hub
hub是该容器在link下的别名(alias),通俗易懂的讲,站在node容器的角度,selenium_hub和hub都是1cbbf6f07804容器的名字,并且作为容器的hostname,node用这2个名字中的哪一个
ENTRTYPOINT CMD两者的联系和区别
# the command of entrypoint
ENTRYPOINT ["nginx"]

CMD ["-g","daemon off;"]
CMD ["/bin/bash"]  == docker run -it images /bin/bash
CMD带的参数会变成ENTRYPOINT的参数

 3.save - load images 镜像

mkdir /opt/images; cd /opt/images
docker images >  /tmp/images.txt ;  awk '{print "docker save -o "$1"_"$2".tar "$1":"$2}' /tmp/images.txt

 

 
posted @ 2018-04-06 17:33  littlevigra  阅读(348)  评论(6编辑  收藏  举报