Docker:来自守护进程的错误响应:没有这样的id:

pi-*_*-2r 4 docker dockerfile

目前我尝试在守护进程启动泊坞窗图像与docker run -d ID(后推出这个COMMANDE: docker build -t toto .)

但是当我发布这个命令时docker exec -it ID bash,我有这个错误:

来自守护进程的错误响应:没有这样的id:toto

我的Dockerfile看起来像这样:

# Dockerfile
FROM debian:jessie

# Upgrade system
RUN apt-get update && apt-get dist-upgrade -y --no-install-recommends

# Install TOR
RUN apt-get install -y --no-install-recommends tor tor-geoipdb torsocks 

# INSTALL POLIPO
RUN apt-get update && apt-get install -y polipo

# INSTALL PYTHON
RUN apt-get install -y python2.7 python-pip python-dev build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev libxslt-dev libxml2-dev && apt-get clean

# INSTALL GIT
RUN apt-get install -y git-core

# INSTALL NANO
RUN apt-get install -y nano

# INSTALL SUPERVISOR
RUN apt-get install -y supervisor

# INSTALL SCRAPY and dependencies
RUN pip install lxml && pip install pyopenssl && pip install Scrapy   && pip install pyopenssl  && pip install beautifulsoup4  && pip install lxml   && pip install elasticsearch   && pip install simplejson  && pip install requests && pip install scrapy-crawlera && pip install avro && pip install stem

# INSTALL CURL
RUN apt-get install -y curl

# Default ORPort
EXPOSE 9001

# Default DirPort 
EXPOSE 9030

# Default SOCKS5 proxy port 
EXPOSE 9050

# Default ControlPort
EXPOSE 9051

# Default polipo Port
EXPOSE 8123

# Configure Tor and Polopo
RUN echo 'socksParentProxy = "localhost:9050"'  >> /etc/polipo/config
RUN echo 'socksProxyType = socks5'  >> /etc/polipo/config
RUN echo 'diskCacheRoot = ""' >> /etc/polipo/config

RUN echo 'ORPort 9001' >> /etc/tor/torrc
RUN echo 'ExitPolicy reject *:*' >> /etc/tor/torrc


ENV PYTHONPATH $PYTHONPATH:/scrapy

WORKDIR /scrapy
VOLUME ["/scrapy"]
Run Code Online (Sandbox Code Playgroud)

提前致谢.

Von*_*onC 7

为了方便使用docker exec,请确保使用名称运行容器:

docker run -d --name aname.cont ...
Run Code Online (Sandbox Code Playgroud)

我没有在Dockerfile中看到入口点或exec,因此请在使用时提及要运行的内容 docker run -d

(我想添加' .cont'作为命名约定,记住它是一个容器名,而不是一个图像名)

然后docker exec aname.contbash应该工作.

检查容器是否仍在使用docker ps -a运行