docker day1

    技术2023-06-11  62

    视频学习,地址:https://edu.51cto.com/center/course/lesson/index?id=71317

    命令:

    docker build -t csphere/centos:7.1 .

    Sending build context to Docker daemon 8.704kB Step 1/12 : FROM centos:centos7.1.1503 centos7.1.1503: Pulling from library/centos c6fb3d2c9cb8: Pulling fs layer error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/e1/e1430271e2f9143e48173bc8e2488b4194c01142ccb16b4f944052f65c6d9f0f/data?verify=1593757951-D%2Buq85hcD3ellyr2JSTS0xYS5M0%3D: Service Unavailable

    查找原因是需要配置加速器

    还是失败了。

    然后准备配置阿里的服务器 1、注册阿里云 2、登陆后获取到url 果然可以用了,但还是要一步一步解决问题

    docker build -t csphere/centos:7.1 .

    No matching distribution found for supervisor The command ‘/bin/sh -c pip install supervisor’ returned a non-zero code: 1

    执行

    /bin/sh -c pip install supervisor

    然后再执行

    docker build -t csphere/centos:7.1 .

    成功。

    docker images docker build -t csphere/php-fpm:5.4 . docker ps -a

    docker run -d -p 8080:80 --name website csphere/php-fpm:5.4 这个启动后,不能够在页面访问到地址。 (发现是自己执行docker build -t csphere/php-fpm:5.4 . 的路径不对 )

    docker ps -l docker rm 5024c0839da7(CONTAINER ID )

    启动 docker run -d -p 8080:80 --name website csphere/php-fpm:5.4

    浏览器:http://localhost:8080/info.php 查看 docker exec -it website /bin/bash

    supervisorctl

    没有学完第一节课,没有时间了。😓

    Processed: 0.014, SQL: 9