2
我正在建造一個基於高山的碼頭堆棧。由於我:爲什麼bin/sh在我的阿爾卑斯碼頭碼頭構建版上找不到?
php7-dockerfile
:
FROM php:7-fpm-alpine
RUN apk update && \\
apk upgrade && \\
apk add --update autoconf gcc
和docker-compose.yml
:
version: "2"
services:
php:
build:
context: .
dockerfile: php7-dockerfile
container_name: test_php
volumes_from:
- data
在運行docker-compose build
我越來越:
Building data
Step 1 : FROM busybox
---> 47bcc53f74dc
Step 2 : ADD ./web /var/www/html
---> Using cache
---> fc7f0c26a44d
Successfully built fc7f0c26a44d
Building php
Step 1 : FROM php:7-fpm-alpine
---> 86c28f7ac7f5
Step 2 : RUN apk update && \ apk upgrade && \ apk add --update autoconf gcc
---> Running in dc5c837f869c
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.1-13-gdf6ff3e [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
v3.4.0-75-g8d1dc52 [http://dl-cdn.alpinelinux.org/alpine/v3.4/community]
OK: 5966 distinct packages available
/bin/sh: : not found
ERROR: Service 'php' failed to build: The command '/bin/sh -c apk update && \ apk upgrade && \ apk add --update autoconf gcc' returned a non-zero code: 127
我很困惑,爲什麼它使用/bin/sh
和爲什麼它沒有被發現,就像我的exi蜇運行容器我可以運行
$ docker exec -it test_php /bin/sh
/var/www/html #
我在做什麼錯?