当我在我工作的Drupal站点上运行docker-compose up时,我得到以下输出:
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/wodby/drupal-php:7.3 1.3s
=> CACHED [1/5] FROM docker.io/wodby/drupal-php:7.3@sha256:05bc175d426b59eea40fd855125b8c86836081e76493f683d8ad40da8f2008e3 0.0s
=> ERROR [2/5] RUN sudo apk add --no-cache autoconf bash build-base openssl libssh2-dev 0.3s
------
> [2/5] RUN sudo apk add --no-cache autoconf bash build-base openssl libssh2-dev:
#4 0.240
#4 0.240 We trust you have received the usual lecture from the local System
#4 0.240 Administrator. It usually boils down to these three things:
#4 0.240
#4 0.240 #1) Respect the privacy of others.
#4 0.240 #2) Think before you type.
#4 0.240 #3) With great power comes great responsibility.
#4 0.240
#4 0.240 sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
#4 0.240 sudo: a password is required
------
executor failed running [/bin/sh -c sudo apk add --no-cache autoconf bash build-base openssl libssh2-dev]: exit code: 1
ERROR: Service 'php' failed to build我一直在寻找,但我不能找到任何我理解的可以修复它的东西。
这是docker-compose.yml:
version: "2"
services:
mariadb:
image: wodby/mariadb:10.1-2.3.3
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
ports:
- "3307:3306"
volumes:
# - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
- ./.persist/mysql:/var/lib/mysql:cached # I want to manage volumes manually.
labels:
- "traefik.backend=mariadb"
- "traefik.port=3306"
- "traefik.frontend.rule=Host:localhost"
php:
# 2. Images without Drupal – wodby/drupal-php:[PHP_VERSION]-[STABILITY_TAG].
# image: wodby/drupal-php:7.1-2.4.3
# image: wodby/drupal-php:7.0-2.1.0
# image: wodby/drupal-php:5.6-2.1.0
# image: wodby/drupal-php:5.3-2.1.0
build: ./build/php
environment:
DOCKER_LOCAL: 1
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: mariadb
DB_USER: drupal
DB_PASSWORD: drupal
DB_NAME: drupal
DB_DRIVER: mysql
PHP_XDEBUG: 1
PHP_XDEBUG_DEFAULT_ENABLE: 1
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0 # This is needed to respect remote.host setting bellow
PHP_XDEBUG_REMOTE_HOST: "10.254.254.254" # You will also need to 'sudo ifconfig lo0 alias 10.254.254.254'
PHP_IDE_CONFIG: "serverName=localhost" # Needed for xdebug for drush commands.
PHP_XDEBUG_REMOTE_AUTOSTART: 0
volumes:
- ./:/var/www/html
- ./.persist/public:/var/www/html/docroot/sites/default/files
- ./.persist/private:/private
nginx:
# wodby/drupal-nginx:[DRUPAL_VERSION]-[NGINX_VERSION]-[STABILITY_TAG].
image: wodby/drupal-nginx:8-1.13-2.4.2
# image: wodby/drupal-nginx:7-1.10-2.1.0
# image: wodby/drupal-nginx:6-1.10-2.1.0
depends_on:
- php
environment:
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/docroot
volumes:
- ./:/var/www/html
- ./.persist/public:/var/www/html/docroot/sites/default/files
labels:
- "traefik.backend=nginx"
- "traefik.port=80"
- 'traefik.frontend.rule=HostRegexp:localhost,{subdomain:[a-z0-9-\\.]+}.localhost, {subdomain:[a-z0-9]+}.ngrok.io'
# varnish:
# image: wodby/drupal-varnish:4.1-2.1.0
# depends_on:
# - nginx
# environment:
# VARNISH_SECRET: secret
# VARNISH_BACKEND_HOST: nginx
# VARNISH_BACKEND_PORT: 80
# labels:
# - 'traefik.backend=varnish'
# - 'traefik.port=6081'
# - 'traefik.frontend.rule=Host:varnish.localhost'
redis:
image: wodby/redis:3.2-2.1.0
# pma:
# image: phpmyadmin/phpmyadmin
# environment:
# PMA_HOST: mariadb
# PMA_USER: drupal
# PMA_PASSWORD: drupal
# PHP_UPLOAD_MAX_FILESIZE: 1G
# PHP_MAX_INPUT_VARS: 1G
# labels:
# - 'traefik.backend=pma'
# - 'traefik.port=80'
# - 'traefik.frontend.rule=Host:pma.localhost'
solr:
## wodby/drupal-solr:[DRUPAL_VERSION]-[SOLR_VERSION]-[STABILITY_TAG].
image: wodby/drupal-solr:8-6.4-2.0.0
## image: wodby/drupal-solr:8-6.3-2.0.0
# image: wodby/drupal-solr:8-5.5-2.0.0
## image: wodby/drupal-solr:7-6.4-2.0.0
## image: wodby/drupal-solr:7-6.3-2.0.0
## image: wodby/drupal-solr:7-5.5-2.0.0
environment:
SOLR_HEAP: 1024m
ports:
- "8983:8983"
volumes:
- ./.persist/solr:/opt/solr/server/solr/core1:delegated
labels:
- "traefik.backend=solr"
- "traefik.port=8983"
- "traefik.frontend.rule=Host:solr.local"
mailhog:
image: mailhog/mailhog
labels:
- "traefik.backend=mailhog"
- "traefik.port=8025"
- "traefik.frontend.rule=Host:mailhog.localhost"
# node:
# image: node:7-alpine
# working_dir: /app
# labels:
# - 'traefik.backend=node'
# - 'traefik.port=3000'
# - 'traefik.frontend.rule=Host:front.localhost'
# expose:
# - "3000"
# volumes:
# - ./path/to/your/single-page-app:/app
# command: sh -c 'npm install && npm run start'
# memcached:
# image: wodby/memcached:1.4-2.0.0
traefik:
image: traefik:1.7
command: -c /dev/null --web --docker --logLevel=INFO --defaultEntryPoints='https,http' --entryPoints='Name:https Address::443 TLS:/certs/local.crt,/certs/local.key' --entryPoints='Name:http Address::80'
ports:
- "80:80"
- "443:443"
# - '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.persist/certs:/certs我在MacOS Big上
所以要求我提供更多细节,因为我的问题主要是代码,但我不确定还能添加什么。我已经看过一些博客帖子,所以答案只有一行,但没有关于把它放在哪里的信息,所以我有点不知所措,因为我不是真的理解这个问题。
发布于 2021-04-12 21:17:29
我对你的被告牌作文有两点建议:
如果您想要一个使用docker compose Version3 drupal应用程序,请查看此链接:drupal-docker-compose-3
https://stackoverflow.com/questions/67057094
复制相似问题