标签: alpine-linux

在alpine中安装php7-gd

这是我的Dockerfile

FROM php:7.1-fpm-alpine
RUN docker-php-ext-install mysqli 
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community/" >>         /etc/apk/repositories &&
apk update && \
apk upgrade && \
apk add --update \
    php7-gd
Run Code Online (Sandbox Code Playgroud)

mysqli没问题,但是它没有加载GD库.

我也在高山容器中找到gd.so,请查看图片:

在此输入图像描述

请帮忙

php gd alpine-linux

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

Alpine包安装协议错误

我正在尝试在高山上安装git 3.6.它Protocol error在第一个实例中失败但在第二个实例上工作.具体pcrelibcurl不是在第一个实例中安装.这是我想要做的日志.

$ docker run -it alpine:3.6 /bin/sh
/ # apk --update add git
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/6) Installing ca-certificates (20161130-r2)
(2/6) Installing libssh2 (1.8.0-r1)
(3/6) Installing libcurl (7.56.1-r0)
ERROR: libcurl-7.56.1-r0: Protocol error
(4/6) Installing expat (2.2.0-r1)
(5/6) Installing pcre (8.41-r0)
ERROR: pcre-8.41-r0: Protocol error
(6/6) Installing git (2.13.5-r0)
Executing busybox-1.26.2-r9.trigger
Executing ca-certificates-20161130-r2.trigger
2 errors; 24 MiB in 15 packages
/ # git
Error loading shared library libpcre.so.1: No such file …
Run Code Online (Sandbox Code Playgroud)

docker alpine-linux

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

错误:无法删除非 root 用户的权限:容器在 Google Cloud Compute Engine 上不断重新启动

我已经搜索过,但似乎找不到此错误的答案。创建新虚拟机时出现“错误:无法删除非 root 用户的权限”。

容器不断重新启动。它在我本地的 MacOS 机器上运行得很好。

我正在尝试在具有容器优化操作系统的 Google Compute Engine VM 上运行该映像。我正在使用 nginx、php-fpm 和 alpine。

Supervisord.conf 文件如下所示:

[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
user=root

[program:php-fpm]
command=php-fpm8 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true

[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
Run Code Online (Sandbox Code Playgroud)

有人也遇到过这个错误吗?

php nginx google-compute-engine docker alpine-linux

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

Alpine中可以安装CloudWatch Agent吗

Alpine 中是否可以安装有效的 CloudWatch 代理包?我们希望在 Alpine 上为 CloudWatch Agent 构建自定义 docker,但可以在https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/download-cloudwatch-agent-commandline.html中进行下载中的可用下载似乎不起作用(我尝试了一些 deb 或 rpm)。

一些错误:无法安装下载的 deb 文件:

/ # dpkg -i -E amazon-cloudwatch-agent.deb
dpkg: error processing archive amazon-cloudwatch-agent.deb (--install):
package architecture (amd64) does not match system (musl-linux-amd64)
Run Code Online (Sandbox Code Playgroud)

并无法安装下载的 rpm 文件:

/ # rpm -U amazon-cloudwatch-agent.rpm
error: Failed dependencies:
/bin/sh is needed by amazon-cloudwatch-agent-1.247347.6b250880-1.x86_64
Run Code Online (Sandbox Code Playgroud)

CloudWatch Agent 是否支持 Alpine 有明确的答案吗?显然它是由 CloudWatch Log Agent 支持的。

amazon-cloudwatch dockerfile alpine-linux

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

php7.2-openssl Alpine Docker 安装错误

我正在使用 Alpine、php7.2-fpm 和 Composer 构建 Docker 镜像。

尝试安装 Composer 时会出现问题,它使用 https 通过 php 下载安装程序。

我添加了存储库以便能够安装 php7.2(用于安装 Composer)及其软件包:

RUN wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub && \
    echo "https://repos.php.earth/alpine/v3.7" >> /etc/apk/repositories && \
    apk update
Run Code Online (Sandbox Code Playgroud)

当我尝试下载composer时出现以下错误:

/ # php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
PHP Warning:  copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. copy() Command line …
Run Code Online (Sandbox Code Playgroud)

php composer-php docker php-openssl alpine-linux

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

OpenJDK 17 Alpine 镜像

我正在寻找基于 alpine 的 openjdk 17 docker 镜像。看起来我们这里有一个

https://hub.docker.com/layers/openjdk/library/openjdk/17-alpine/images/sha256-a996cdcc040704ec6badaf5fecf1e144c096e00231a29188596c784bcf858d05?context=explore

但下面的存储库显示它尚未准备好正式发布。所以我想知道上面的docker镜像从哪里获取源文件。

http://jdk.java.net/17/

java alpine-linux openjdk-17

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

为什么在 Docker(在 Mac 上)上安装软件包时出现 SSL 错误?

我在 MacOS 上通过 Docker Desktop 运行 Docker,在容器中安装软件包时遇到很多麻烦,因为它无法验证任何 ssl 证书。

\n

apk update例如,当我运行时,我收到此错误:

\n
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz\n139797308250952:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1914:\nERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/main: Permission denied\n
Run Code Online (Sandbox Code Playgroud)\n

当我尝试bundle install

\n
Could not verify the SSL certificate for https://rubygems.org/.\nThere is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn\'t have the CA certificates needed for verification.\n
Run Code Online (Sandbox Code Playgroud)\n

甚至是一个简单的卷曲curl https://google.com.br

\n
curl: (60) SSL certificate problem: unable to get local issuer certificate\nMore details here: https://curl.se/docs/sslcerts.html\n\ncurl failed to …
Run Code Online (Sandbox Code Playgroud)

macos ssl docker alpine-linux docker-desktop

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

docker中npm start启动node应用程序的问题

我阅读了一些Docker 和 Node.js 最佳实践文章,例如https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md使用 Docker 容器化 Node.js Web 应用程序的 10 个最佳实践,或者Node 和 NPM 的 Dockerfile 良好实践。所有这些文章至少是在 2021 年写或更新的,我不列出 2021 年之前写的文章,但也有不少。

\n

他们都反对CMD ["npm", "run", "start"]。主要原因是 npm 会吞掉SIGTERM 和 SIGINT 等退出信号,因此我的节点应用程序中的正常关闭代码将无法运行。

\n

我猜旧的 npm 就是这种情况(虽然我没有测试它),但我已经测试了 node14+npm6 和 node16+npm8,我可以验证 npm6/8 不会吞下这些事件和我的优雅关闭代码正在运行。不确定这是否是因为 npm 修复了它。

\n

因此,唯一的问题仍然是还有 1 个进程 npm 需要运行,即 NPM 作为PID 1运行。一些文章说问题是“PID 1 不会响应 SIGINT”,但据我证实,情况并非如此。

\n

许多文章(例如这个nodejs文档)建议只是,CMD [ "node", "server.js" ]但也在https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals …

signals node.js npm docker alpine-linux

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

nginx 和 nginx:alpine 有什么区别?

我的目标是理解为什么会有nginx图像和nginx:alpine图像。

我知道的:

  1. nginx更大,52.79 MB。
  2. nginx使用debian:bullseye-slim.
  3. nginx:alpine较小,为 9.51 MB。
  4. nginx:alpine使用alpine.
  5. 两个图像都可以很好地运行静态 htmldocker run -p 8080:80 -v ${PWD}:/usr/share/nginx/html nginx:alpine

我无法理解为什么默认图像使用debian:bullseye-slim而不是alpine.

nginx debian-based docker alpine-linux

5
推荐指数
0
解决办法
5109
查看次数

PHP NumberFormatter 总是给我默认的 en_US

当尝试在我的 PHP 8.1 alpine docker 容器中格式化货币时,我总是得到默认区域设置 (en_US)。

\n
$ docker run -it --rm php:8.1-fpm-alpine /bin/ash\n# apk update && apk add icu-dev\n# docker-php-ext-configure intl && docker-php-ext-install intl\n# php -a\n> $formatter = new NumberFormatter('nl_NL', NumberFormatter::CURRENCY);\n> echo $formatter->getLocale();\nen_US\n> echo $formatter->format(1234.567);\n\xe2\x82\xac1,234.57\n
Run Code Online (Sandbox Code Playgroud)\n

我期望 getLocale() 返回 nl_NL 和 format 返回 \xe2\x82\xac1.234,57。

\n

如果我尝试 locale en_GB,getLocale() 确实返回 en_GB。

\n

也欢迎任何有关编写更好问题的建议。

\n

php intl docker alpine-linux

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