zoukankan      html  css  js  c++  java
  • docker guide

    centos docker community version install:

    yum -y install docker         # install docker
    systemctl start docker.service               # start docker service
    systemctl enable docker.service       # enale docker service when power on
    docker run hello-world  # need to pull from docker repository the first time


    docker container:

    docker build -t friendlyname . # Create image using this directory's Dockerfile
    docker run -d -p 4000:80 friendlyname # detached mode,4000(image) 80(localhost)
    docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
    docker container ls # List all running containers
    docker container ls -a # List all containers, even those not running
    docker container stop <hash> # Gracefully stop the specified container
    docker container kill <hash> # Force shutdown of the specified container
    docker container rm <hash> # Remove specified container from this machine
    docker container rm $(docker container ls -a -q) # Remove all containers
    docker image ls -a # List all images on this machine
    docker image rm <image id> # Remove specified image from this machine
    docker image rm $(docker image ls -a -q) # Remove all images from this machine
    docker login # Log in this CLI session using your Docker credentials
    docker tag <image> username/repository:tag # Tag <image> for upload to registry
    docker push username/repository:tag # Upload tagged image to registry
    docker run username/repository:tag # Run image from a registry


    docker services:

    docker swarm init # first time you deploy an app or after you shutdown the swarm
    docker stack ls # List stacks or apps
    docker stack deploy -c <composefile> <appname> # Run the specified Compose file
    docker service ls # List running services associated with an app
    docker service ps <service> # List tasks associated with an app
    docker inspect <task or container> # Inspect task or container
    docker container ls -q # List container IDs
    docker stack rm <appname> # Tear down an application
    docker swarm leave --force # Take down a single node swarm from the manager


    docker swarm:

    docker pull docker.io/vickeywu/docker_test:test
    or docker run -p 8080:8080 vickeywu/docker_test:test
    curl localhost:8080
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum -y install kernel-devel kernel-headers dkms
    yum -y groupinstall "Development Tools"
    yum -y update
    wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
    rpm --import oracle_vbox.asc
    wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
    yum -y install VirtualBox-5.1
    systemctl start vboxdrv.service
    usermod -a -G vboxusers root

    references:

    install:http://www.linuxidc.com/Linux/2014-12/110034.htm

    container:https://docs.docker.com/get-started/

     swarm:http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-virtualbox-4-3-on-centos-7-rhel-7.html

  • 相关阅读:
    爬取网易云音乐歌手和id
    【兼容调试】cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS
    python如何去掉字符串‘xa0’
    python 中json和字符串互相转换
    vip视频播放
    一行Python代码画心型
    Java语言编写MD5加密方法,Jmeter如何给字符串MD5加密
    转载:oracle RAC集群启动和关闭
    转载:oracle 11g ADG实施手册(亲测,已成功部署多次)
    如何上传本地文件到github又如何删除自己的github仓库
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/7978172.html
Copyright © 2011-2022 走看看