相关疑难解决方法(0)

错误:不可满足的约束 - 关于php:7-fpm-alpine

我正在寻找在fpm-alpine容器上设置laravel.遇到以下Dockerfile产生一些错误的障碍......

FROM php:7-fpm-alpine

# install extensions needed for Laravel
RUN apk --update add \
  php7-mysqli \
  php7-mcrypt \
  php7-mbstring \
  rm /var/cache/apk/*
Run Code Online (Sandbox Code Playgroud)

产生的错误是:

Building fpm
Step 1 : FROM php:7-fpm-alpine
 ---> 9e6811cb8bac
Step 2 : RUN apk --update add   php7-mysqli   php7-mcrypt   php7-mbstring   rm /var/cache/apk/*
 ---> Running in 87364957eb57
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  /var/cache/apk/* (missing):
    required by: world[/var/cache/apk/*]
  php7-mbstring (missing):
    required by: world[php7-mbstring]
  php7-mcrypt (missing):
    required by: world[php7-mcrypt]
  php7-mysqli (missing):
    required by: world[php7-mysqli]
  rm (missing):
    required by: world[rm] …
Run Code Online (Sandbox Code Playgroud)

docker alpine-linux

5
推荐指数
2
解决办法
8643
查看次数

无法在高山图像上使用 PostGIS

我正在尝试使用Alpine图像来处理一些Postgres数据库创建/准备工作。在容器内,我正在运行以下命令:

createdb -e -O ${DB_USER} ${DB_NAME}
psql -e -d ${DB_NAME} -c "CREATE EXTENSION postgis;"
Run Code Online (Sandbox Code Playgroud)

第一行工作正常,但第二行不行。

我已经用两个 docker 构建尝试过这个:

  1. 以下 Dockerfile:
FROM alpine:3.6

RUN apk add -U postgresql

COPY ./db-creator.sh /db-creator.sh
CMD ["./db-creator.sh"]

Run Code Online (Sandbox Code Playgroud)

这张图片给了我以下错误:

CREATE EXTENSION postgis;
ERROR:  could not open extension control file "/usr/share/postgresql/10/extension/postgis.control": No such file or directory
Run Code Online (Sandbox Code Playgroud)

我没有尝试PostGIS直接安装,因为本论坛中有人坚持认为apk add -U postgresqlAlpine图像就足够了。

  1. 以下 Dockerfile:
FROM postgres:9.6.4-alpine

RUN apk add -U postgresql
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN …
Run Code Online (Sandbox Code Playgroud)

postgresql postgis docker alpine-linux

5
推荐指数
1
解决办法
1716
查看次数

错误:在 Alpine Docker 映像上安装 PostGIS 时出现无法满足的约束

好的,所以任务看起来很简单!使用Alpine图像(因为它轻量级且安全)来执行一些PostgreSQL数据库创建/迁移。我使用的是以下Dockerfile使用的代码在这里

FROM alpine:latest

RUN apk add -U postgresql

# install PostGIS
ENV POSTGIS_VERSION 2.5.2
ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9
RUN set -ex \
    \
    && apk add --no-cache --virtual .fetch-deps \
        ca-certificates \
        openssl \
        tar \
    \
    && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
    && echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
    && mkdir -p /usr/src/postgis \
    && tar \
        --extract \
        --file postgis.tar.gz \
        --directory /usr/src/postgis \
        --strip-components 1 \
    && rm …
Run Code Online (Sandbox Code Playgroud)

postgresql postgis docker alpine-linux

4
推荐指数
1
解决办法
1882
查看次数

标签 统计

alpine-linux ×3

docker ×3

postgis ×2

postgresql ×2