构建图像或创建容器没有问题。
附着在容器上是个问题,它似乎会永远阻塞并挂起。
我在做什么错了?
Docker-compose :
version: '3.7'
services:
LAMP:
build: ./Apache
image : lamp_nzh:1
container_name: lamp_nzh
ports:
- "80:80"
tty: true
Docker File :
# Environnement Ubuntu
FROM ubuntu:latest
# Email du maintenair
MAINTAINER ZHITI Nicolas <nzhiti@gmail.com>
#Environnement
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
# Mise à jours du système
RUN apt-get update
RUN apt-get upgrade -yqq
# Installation unzip
RUN apt-get install -yqq zip unzip
# Installation LAMP
RUN apt-get install -yqq \
apache2 \
php \
libapache2-mod-php \
mariadb-server \
php-mysql
# Installation modules
RUN apt-get install php-curl php-gd php-intl php-json php-mbstring php-xml php-zip -yqq
# Port 80 (dans un premier temps)
EXPOSE 80
#Copies
COPY ./www/ /var/www/html/
COPY ./vhosts /etc/apache2/site-available
Docker版本::Docker 18.06.1-ce版本,构建e68fc7a
Docker-compose版本::docker-compose版本1.23.2,内部版本1110ad01
编辑:这是docker-compose --verbose up,看来这是网络问题。
Attaching to lamp_nzh
compose.cli.verbose_proxy.proxy_callable: docker events <- (filters={'label': ['com.docker.compose.project=webserver', 'com.do cker.compose.oneoff=False']}, decode=True)
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.38/events?filters=%7B%22label%22%3A+%5B%22com.docker.comp ose.project%3Dwebserver%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker events -> <docker.types.daemon.CancellableStream object at 0x7fe8dfd00710>