Использование docker-compose для сборки на основе существующего dockerfile с некоторыми небольшими изменениями завершается неудачно с:
Step 1/10 : FROM alpine:latest
---> 055936d39205
Step 2/10 : LABEL MAINTAINER="Peter Winter <peter@pwntr.com>" Description="Simple and lightweight Samba docker container, based on Alpine Linux." Version="1.0.2"
---> Using cache
---> e99eafd27cc6
Step 3/10 : RUN apk --no-cache upgrade && apk --no-cache add samba samba-common-tools supervisor
---> Running in 99c71d23252f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: could not connect to server (check repositories file)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz: could not connect to server (check repositories file)
OK: 6 MiB in 14 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: could not connect to server (check repositories file)
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz: could not connect to server (check repositories file)
ERROR: unsatisfiable constraints:
samba (missing):
required by: world[samba]
samba-common-tools (missing):
required by: world[samba-common-tools]
supervisor (missing):
required by: world[supervisor]
ERROR: compose.cli.main.main: Service 'samba' failed to build: The command '/bin/sh -c apk --no-cache upgrade && apk --no-cache add samba samba-common-tools supervisor' returned a non-zero code: 3
Похоже, что не используется прокси?
docker-compose.yml
version: "3.7"
services:
samba:
#image: pwntr/samba-alpine
build:
context: .
dockerfile: Dockerfile
container_name: samba
volumes:
- /some/path:/shared:ro
restart: unless-stopped
Я попытался установить аргументы и разделы среды с деталями прокси, но без разницы.
version: "3.7"
services:
samba:
#image: pwntr/samba-alpine
build:
context: .
dockerfile: Dockerfile
# args: # Environment variables available at build-time
# - http_proxy=http://127.0.0.1:3128
# - https_proxy=http://127.0.0.1:3128
# - HTTP_PROXY=http://127.0.0.1:3128
# - HTTPS_PROXY=http://127.0.0.1:3128
# environment: # Environment variables available at container run-time
# - http_proxy=http://127.0.0.1:3128
# - https_proxy=http://127.0.0.1:3128
# - HTTP_PROXY=http://127.0.0.1:3128
# - HTTPS_PROXY=http://127.0.0.1:3128
container_name: samba
volumes:
- /some/path:/shared:ro
restart: unless-stopped
Если я использую docker run
или через изображение, все работает нормально.
version: "3.7"
services:
samba:
image: pwntr/samba-alpine
container_name: samba
volumes:
- /some/path:/shared:ro
restart: unless-stopped
Сервер / Хост работает на Alpine Linux с нормально работающими соединениями.
docker info | grep -i proxy
HTTP Proxy: http://127.0.0.1:3128/
HTTPS Proxy: http://127.0.0.1:3128/