Think before you speak, read before you think.

Category: Docker

  • docker run ftp

    docker run -e FTP_USER_NAME=jpuyy -e FTP_USER_PASS=123456 -e FTP_USER_HOME=/home/jpuyy -d –name ftpd_server -p 21:21 -p 30000-30009:30000-30009 -e “PUBLICHOST=0.0.0.0” stilliard/pure-ftpd

  • docker swarm

    Usage: docker service COMMAND Manage services Commands: create Create a new service inspect Display detailed information on one or more services logs Fetch the logs of a service or task ls List services ps List the tasks of one or more services rm Remove one or more services rollback Revert changes to a service’s configuration…

  • docker-compose

    sudo pip install -U docker-compose 编写 version: ‘3.2’ services: db: image: mysql:5.7.21 container_name: mysql hostname: mysql-test-1 restart: always ports: – 3306:3306 environment: – MYSQL_ALLOW_EMPTY_PASSWORD=YES volumes: – ./tmp:/var/lib/mysql broker: image: redis:3.0-alpine command: redis-server container_name: broker hostname: broker-test-1 restart: always ports: – 6379:6379 volumes: – ./tmp:/var/lib/redis 拉起 docker docker-compose up -d

  • docker 网桥

    Docker 创建出来的每一个容器,都会创建一个虚拟的以太网设备(Veth 设备对),其中一端关联到网桥上,另一端使用 Linux 的网络命名空间技术,映射到容器内的 eth0 设备。 以 CentOS 为例,安装工具 yum install -y bridge-utils 查看桥接 brctl show

  • k8s 更新 docker image

    如果 docker tag 不一样 kubectl set image deployment/myapp myapp=10.10.10.222:5000/myapp:v1.0.1 -n web 如果 docker tag 一样,image digest 不一样,则更新 image 使用 digest 查看 digest docker images –digests 更新 image kubectl set image deployment/myapp myapp=10.10.10.222:5000/myapp@sha256:f9d3c70ca6eb35bf33077f308dc526472d21d80b0234121bc93ada58bce99ee9 -n web

  • docker image 迁移

    要迁移 docker image 有三个方法 1.拿到 docker repo, Dockerfile 重新 build docker build . 2.通过 docker registry docker pull image 3.打包后通过文件迁移 保存一个 tar 文件 docker save -o fedora-latest.tar fedora:latest 把文件传输到目标机器 docker load -i path to image tar file