【发布时间】:2018-01-25 20:46:01
【问题描述】:
在构建docker apache镜像时,这一步构建失败:
Step n/m : COPY httpd-foreground /usr/local/bin/
错误:服务“apache”构建失败:复制失败:stat /var/lib/docker/tmp/docker-builder511740141/httpd-foreground:没有这样的 文件或目录
这是我的 docker_compose.yml 文件
version: '3'
services:
mysql:
image: mysql:5.7
container_name: mysql_octopus_dev
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: app
MYSQL_USER: root
MYSQL_PASSWORD: root
apache:
build: .
container_name: apache_octopus_dev
volumes:
- .:/var/www/html/
ports:
- "8000:80"
depends_on:
- mysql
这是我的 docker 文件
FROM debian:jessie-backports
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
#RUN groupadd -r www-data && useradd -r --create-home -g www-data www-data
...
COPY httpd-foreground /usr/local/bin/
EXPOSE 80
CMD ["httpd-foreground"]
有什么帮助吗?
【问题讨论】:
-
在您的构建上下文(
docker build命令末尾的目录)中是否有一个名为httpd-foreground的文件。您是否使用.dockerignore将其排除在外? -
不,我没有 .dockerignore 文件,我将文件放在错误的路径中。
标签: apache docker docker-compose