标签: alpine-linux

在 Docker 镜像中添加 PHP zip 扩展名

我正在尝试安装我的 PHP 容器的 Zip 扩展php:7.4-fpm-alpine

这就是我在Dockerfile中使用的内容

RUN apk add --no-cache zip libzip-dev
RUN docker-php-ext-configure zip --with-libzip=/usr/include
RUN docker-php-ext-install zip
Run Code Online (Sandbox Code Playgroud)

但它给了我这个错误:

配置:错误:无法识别的选项:--with-libzip 错误:服务“php”无法构建:命令“/bin/sh -c docker-php-ext-configure zip --with-libzip=/usr/include”返回非零代码:1

php docker alpine-linux

3
推荐指数
1
解决办法
1万
查看次数

安装pdftk alpine linux时出现不可满足的约束错误

尝试安装时pdftk apk抛出此错误。

ERROR: unsatisfiable constraints:
  pdftk (missing):
    required by: world[pdftk]
Run Code Online (Sandbox Code Playgroud)

这是整个输出:

/opt/app # apk add pdftk
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
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  pdftk (missing):
    required by: world[pdftk]
Run Code Online (Sandbox Code Playgroud)

我是 apk 新手,不确定问题的含义或如何解决它。

linux alpine-linux alpine-package-keeper

3
推荐指数
1
解决办法
2367
查看次数

错误:无法启动 nginx,因为网络无法在 alpine docker 镜像上启动

我们正在尝试在基于 java 的 alpine 镜像 ( ) 上安装并运行 nginx anapsix/alpine-java:7_jdk,但启动时遇到以下错误

rc-service nginx start
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpu/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpu,cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: can't create /sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 250: …
Run Code Online (Sandbox Code Playgroud)

nginx docker dockerfile alpine-linux nginx-reverse-proxy

3
推荐指数
1
解决办法
2441
查看次数

无法使用 Alpine 和 Busybox docker 镜像运行可执行文件

我正在尝试创建一个非常简单的 docker 映像,它必须预装 lua、luarocks 和其他一些可执行文件,dockerfile 如下:

FROM busybox AS builder

WORKDIR /usr/local/bin

# installs curl (reliable alternative to wget)
RUN wget -O curl https://github.com/moparisthebest/static-curl/releases/download/v7.79.1/curl-amd64 && \
    chmod +x curl

# installs luaformatter
RUN wget -O lua-format https://github.com/Koihik/vscode-lua-format/raw/master/bin/linux/lua-format && \
        chmod +x lua-format

# installs stylua
RUN wget -O stylua-0.11.0-linux.zip https://github.com/JohnnyMorganz/StyLua/releases/download/v0.11.0/stylua-0.11.0-linux.zip && \
        unzip stylua-0.11.0-linux.zip && \
        rm stylua-0.11.0-linux.zip && \
        chmod +x stylua

# installs selene
RUN wget -O selene-light-0.14.0-linux.zip https://github.com/Kampfkarren/selene/releases/download/0.14.0/selene-light-0.14.0-linux.zip && \
        unzip selene-light-0.14.0-linux.zip && \
        rm selene-light-0.14.0-linux.zip && …
Run Code Online (Sandbox Code Playgroud)

linux lua sh docker alpine-linux

3
推荐指数
1
解决办法
5974
查看次数

无法在 Alpine 上的多架构构建中安装 bash

linux/arm64/v8我正在尝试为Gitlab 运行程序构建图像linux/amd64。我用这个命令运行它:

docker buildx create --use
docker buildx build --platform linux/arm64/v8 -f Dockerfile.dev -t registry.gitlab.com/xxx:yyy --build-arg ENV=dev --build-arg COMPOSER_AUTH_FILE=./auth.json .
Run Code Online (Sandbox Code Playgroud)

我的 Dockerfile 相当简单:

FROM alpine:latest

RUN apk update && \
    apk add --no-cache composer git bash openssh-client patch && \
    apk add --no-cache libzip-dev libpng-dev libxslt-dev curl-dev libxml2-dev icu-dev oniguruma-dev freetype-dev libjpeg-turbo-dev
Run Code Online (Sandbox Code Playgroud)

但它失败了:

#6 [2/2] RUN apk update &&     apk add --no-cache composer git bash openssh-client patch &&     apk add --no-cache libzip-dev libpng-dev libxslt-dev curl-dev libxml2-dev icu-dev …
Run Code Online (Sandbox Code Playgroud)

linux gitlab docker gitlab-ci alpine-linux

3
推荐指数
1
解决办法
1587
查看次数

为什么创建镜像时docker找不到TensorFlow CPU 2.7.0?

我正在使用以下 Dockerfile 构建 Docker 映像:

FROM python:3.8-alpine
EXPOSE 5000/tcp
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
CMD [ "python", "./app.py" ]
Run Code Online (Sandbox Code Playgroud)

这是我使用的命令:

docker build -t my-language-app:1.0 .
Run Code Online (Sandbox Code Playgroud)

它给出了这个错误:

[+] Building 91.5s (9/9) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 32B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/python:3.8-alpine                                               3.3s
 => [auth] library/python:pull token for registry-1.docker.io                                                      0.0s
 => [internal] load build context …
Run Code Online (Sandbox Code Playgroud)

python docker alpine-linux tensorflow

3
推荐指数
1
解决办法
3051
查看次数

`pip3 install grpcio` 在 Alpine Linux 上失败

我在 Mac (12.3.1) 上使用 Docker 的 Alpine Linux 并尝试运行pip3 install grpcio但此命令总是失败。

\n

我在这里尝试了信息,但到目前为止没有任何效果。
\n无法使用 pip install grpcio 安装 grpcio --> 升级到最新版setuptools\n https://github.com/grpc/grpc/issues/24390 --> 运行export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1

\n

\n
    \n
  1. 使用此 Dockerfile 构建映像。
  2. \n
\n

Dockerfile

\n
FROM alpine:latest\nCOPY src /root/src # Please think this is empty. I don\'t use any files in this directory until now.\nWORKDIR /root/src\n\nRUN set -x \\\n    && apk update \\\n    && apk add build-base \\\n    && apk …
Run Code Online (Sandbox Code Playgroud)

python pip alpine-linux grpcio

3
推荐指数
1
解决办法
2881
查看次数

在 Python Alpine Docker 中加载共享库 libresolv.so.2 时出错

我在 CI/CD (Jenkins) 中使用 Alpine Linux 作为我的 Python 应用程序的 Docker 镜像。这是针对 AWS Lambda 的,基本上唯一值得注意的要求是aws-psycopg2访问 Postgres。本地一切正常,它可以很好地使用无服务器部署并在 AWS 上运行,唯一的问题是在 Jenkins 上。我在那里收到错误:

16:24:55  ImportError: Error loading shared library libresolv.so.2: No such file or directory (needed by /usr/local/lib/python3.9/site-packages/psycopg2/../psycopg2_binary.libs/libgssapi_krb5-497db0c6.so.2.2)
Run Code Online (Sandbox Code Playgroud)

我没有以任何方式使用 Oracle,例如在这个问题中

我的jenkinsfile.groovy

def testInstallStage = {
  stage('Install') {
    sh 'apk add python3-dev gcc libc-dev musl-dev openblas gfortran build-base postgresql-libs postgresql-dev libffi-dev cargo'
    sh 'pip install --upgrade pip && pip install poetry'
    sh 'poetry export --without-hashes --dev -f requirements.txt -o …
Run Code Online (Sandbox Code Playgroud)

python amazon-web-services jenkins docker alpine-linux

3
推荐指数
1
解决办法
3199
查看次数

Docker 和 Spring boot 给出的“sun.awt.FontConfiguration.head”为 null

我目前有一个使用 Spring Boot 构建的应用程序。我正在使用 Jasper 报告。当我尝试生成报告时,出现以下错误:

java.lang.NullPointerException:无法从短数组加载,因为 java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1260) 处的“sun.awt.FontConfiguration.head”为空 ~[na:na]

该应用程序在我的计算机上运行良好,仅在 docker 中失败。

这是我的 Dockerfile:

FROM openjdk:17-alpine
EXPOSE 10093
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} site_informativo.jar

RUN apk update;
RUN apk add -f apt-utils;
RUN apk add -f libfreetype6;
RUN apk add --no-cache -f fontconfig;
RUN apk add -f fonts-dejavu;
RUN apk add -f msttcorefonts;
RUN apk add -f libfontconfig1;
RUN apk add -f freetype;
RUN fc-cache --force

ENTRYPOINT ["java","-jar","/site_informativo.jar"]
Run Code Online (Sandbox Code Playgroud)

我还在 pom.xml 中添加了 jasperreports-fonts EXTENSION 但问题仍然存在

<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
<dependency> …
Run Code Online (Sandbox Code Playgroud)

java jasper-reports docker alpine-linux

3
推荐指数
1
解决办法
1万
查看次数

ruby3.2.1 更新后 Active::Record 的 params.permit 未定义方法 `=~'

最近我从ruby3.1.2-alpine3.15->更新ruby3.2.1-alpine3.17,我做的唯一的 gem 更新是mysql2,从0.5.30.5.5支持 openssql3。并遵循Ruby3.2.0 Breaking Changes并添加--jit --yjit标志。几乎所有应用程序都运行良好。但不知怎的,一段代码却没有。只是一个简单的params.permit

\n
permitted_params = params.permit(:category_id, :private, tags: [])\n
Run Code Online (Sandbox Code Playgroud)\n

失败的原因是

\n
NoMethodError:\n       undefined method `=~\' for #<HereGoes::MyModel>\n
Run Code Online (Sandbox Code Playgroud)\n

我的params看起来像这样:(其中“字段”只是额外的数据)。我看到的唯一奇怪的事情是嵌套的ActionController::Parameters,但同样的参数在旧的 ruby​​ 版本中解析得很好。

\n
"#<ActionController::Parameters  {\\"field_values\\"=>[#<ActionController::Parameters \n{\\"field_id\\"=>4, \\"value\\"=>\\"Test changed\\", \\"type\\"=>\\"string\\"} permitted: false>], #\n<HereGoes::MyModel id: nil, category_id: nil, uuid: \\"87ebb507-e381-4d57-b66c-10e51f10c014\\", \ncreated_at: nil, updated_at: nil, name: \\"Alphazap5\\", \\"fields\\"=> {\\"Viva11\\"=>nil,\\"Y-solowarm4 \nTextField\\"=>nil,\\"Y-solowarm4 StringField\\"=>nil,\\"Y-solowarm4 LocationsField\\"=>nil}}, \nbackup_id: 0, options: {}, tag_list: nil>=>{\\"id\\"=>1}} …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails alpine-linux

3
推荐指数
1
解决办法
140
查看次数