Docker组合卷无效的字符

无法使用docker构build容器

Docker version 1.9.1, build a34a1d5 

Dockerfile

 FROM ubuntu # File Author / Maintainer MAINTAINER Parzee [email protected] # Install Components. # Update the repository ENV LANG en_US.UTF-8 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update RUN locale-gen en_US en_US.UTF-8 # Install necessary tools RUN apt-get install -y nano vim wget dialog net-tools RUN apt-get install lighttpd -y RUN apt-get install php5-common php5-cgi php5 -y RUN lighty-enable-mod fastcgi-php RUN update-rc.d -f lighttpd disable RUN mkdir -p /usr/local/src/imbue/application/imbue/utils/security/des ADD lighttpd.conf /etc/lighttpd/ VOLUME ["/var/log/lighttpd"] RUN ls -al /etc/lighttpd/lighttpd.conf RUN /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf EXPOSE 8083 

泊坞窗,compose.yml

 lighttpd: image: parzee/lighttpd ports: - "8083:8083" volumes: - volumes/log:/var/log/lighttpd 

当我运行:

 docker run -h lighttpd -p 8083:8083 -d -v `pwd`/volumes/log:/var/log/lighttpd -t parzee/lighttpd 

我的容器启动正常,但与docker – 撰写了我得到以下错误:

 Creating lighttpd_lighttpd_1 ERROR: volumes/log includes invalid characters for a local volume name, only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed 

这是文件结构:

 . ├── docker-compose.yml ├── Dockerfile ├── lighttpd.conf └── volumes ├── etc │  └── lighttpd │  └── lighttpd.conf └── log 4 directories, 4 files 

docker工作人员相当挑剔。 确保path是绝对的(对于主机端)并且不包含尾随空格。

 "- volumes/log:/var/log/lighttpd " 

应该

 "- /host/path/volumes/log:/var/log/lighttpd" 

没有引号! 我把这些放在突出问题。

如果你真的需要相对path考虑使用起重机,而不是docker组成。