这是我的Dockerfile:
FROM golang
# RUN cat /etc/*release
RUN apt-get update
RUN apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
RUN apt-get update
RUN apt-get -y install docker-ce
RUN docker run hello-world
Run Code Online (Sandbox Code Playgroud)
golang Dockerfile是官方的,它基于
Debian GNU/Linux 8 (jessie)
Run Code Online (Sandbox Code Playgroud)
所以我通过检查Docker Install Tutor(Debian)的安装步骤写下了这个Dockerfile
但输出是
Step 8/8 : RUN docker run hello-world
---> Running in b183b8cc5d10
docker: Cannot connect to the Docker daemon at
unix:///var/run/docker.sock. Is …Run Code Online (Sandbox Code Playgroud)