$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
docker exec -it 容器id bash
sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
docker pull image_name:versionx
dcoekr run -d --name=lamp -p 80:80 -v /mysql_data:/var/lib/mysql 镜像id
docker exec -it 容器id bash
FROM ubuntu:18.04 # 从哪个镜像基础上开始操作
# 作者,不是必须的
LABEL maintainer="phithon <root@leavesongs.com>"
#运行的时候默认选择Y,不安装非必须的依赖包(shell尽量放在一层上)
RUN apt-get install -y --no-install-recommends
# 不安装非必须依赖包
RUN pip --no-cache-dir install httpstat
ADD
# 如果使用的是集成环境,可以使用ENV设置环境中MySQL_ROOT的默认密码
ENV MYSQL_ROOT_PASSWORD=password
docker build -t 镜像名 .
FROM thiagobarradas/lamp:php-7.2
RUN rm -rf /app
COPY ./apps /app
ENV MYSQL_PASS=admin
# RUN mysql -e "set password for 'root'@'localhost' = password('root');"
EXPOSE 80 3306
CMD ["/run.sh"]
# 参考链接:
# https://hub.docker.com/r/tutum/lamp
#
#
error pulling image configuration: Get https://production.cloudflare.docker.com/
registry-v2/docker/registry/v2/blobs/sha256/1c/1cda43d811c8fb178d9b0aacbdfaaa4e4
f36489e2112558c84a97549f868585c/data?verify=1608172124-zf3G3JFGipnlE3G24jL3h8nIKg
w%3D: dial tcp: lookup production.cloudflare.docker.com: Temporary failure in name
resolution
nameserver 8.8.8.8
# 报错内容---ubuntu18.04
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io: No address associated with hostname