当运行alpine docker容器并尝试构建时,我收到了这样的错误消息。
/bin/sh: /etc/init.d/postgresql: not found
这是我的Dockerfile:
FROM alpine:3.5
MAINTAINER hoge
ENV LANG en_US.utf8
ENV PHX_PORT 4000
ENV PHX_DBNAME hoge_db
COPY release.tar.gz /
RUN echo 'http://dl-3.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
RUN apk update && apk upgrade && \
apk add --no-cache --virtual .base_deps build-base openssl-dev zlib-dev libxml2-dev wget gnupg ca-certificates && \
apk add --no-cache readline-dev glib-lang libssl1.0 postgresql postgresql-client && \
apk add --update binutils && \
apk add --no-cache sudo && \
apk --purge del .base_deps && \
tar -xzf ./release.tar.gz && \
echo "postgres ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/postgres && \
chmod 600 /etc/sudoers.d/postgres && \
sync && \
/etc/init.d/postgresql setup && \
/etc/init.d/postgresql start && \
readelf -l /etc/init.d/postgresql | grep "program interpreter" && \
psql -U postgres -c "CREATE DATABASE $PHX_DBNAME WITH ENCODING 'UTF8' OWNER=postgres TEMPLATE = template0;"
VOLUME /var/lib/postgresql/data
ENTRYPOINT ["psql", "-U", "postgres"]
EXPOSE 5432
/etc/init.d/postgresql
肯定存在
我确实通过实际进入容器确认存在
我该如何修改?
答案 0 :(得分:2)