docker logs -f my-container-name
类似 tail -f
docker logs -n 10 my-container-name
显示最近 10 行./var/lib/docker
下文件可以清理掉, 然后重新 docker pull
.docker build -f <dockerfile> <build-context-path>
构建镜像 (image), 构建镜像需要一个 Dockerfile 文件和一个构建上下文 (build context)./
目录或者其他过大的目录作为构建上下文.LABEL home="http://gitlab.widget-inc.com/her/her-gateway" \
private="true"
ENV GATEWAY_VERSION="0.19.3" \
NODE_VERSION="0.12.9"
RUN addgroup -S redis && adduser -S -G redis redis
LABEL home http://gitlab.widget-inc.com/her/her-gateway
LABEL private true
ENV GATEWAY_VERSION 0.19.3
ENV NODE_VERSION 0.12.9
RUN addgroup -S redis
RUN adduser -S -G redis redis
还有要有人回答下,docker服务端和客户端需要通过/var/run/docker.sock通信,这个目录需要root才能读写 我也尝试过chmod这个文件,以后客户端不用root也可以正常地执行命令