我正在尝试在 Alpine Linux 上构建 GCC。我没有 root 访问权限或启用 sudo 的用户。我正在关注GCC Wiki。我得到了这个输出。
~/objdir $ $PWD/../gcc-5.2.0/configure --prefix=$HOME/gcc-5.2.0 --enable-languages=c,c++,fortran,go
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for libatomic support... …Run Code Online (Sandbox Code Playgroud) 我正在尝试在基于官方 Python 映像的 Alpine Linux 发行版的自定义 Docker 映像中安装Pylint。我尝试使用以下 Dockerfile:
FROM python:3.4-alpine
RUN apk add --update pylint
Run Code Online (Sandbox Code Playgroud)
<< 这失败了
Step 2/2 : RUN apk add --update pylint
---> Running in 34949003816d
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
ERROR: unsatisfiable constraints:
pylint (missing):
required by: world[pylint]
The command '/bin/sh -c apk add --update pylint' returned a non-zero code: 1
Run Code Online (Sandbox Code Playgroud)
此外,我试过
FROM python:3.4-alpine
RUN pip3 install pylint
Run Code Online (Sandbox Code Playgroud)
<< 这失败了
Step 2/2 : RUN pip3 install pylint
---> Running in b044e3347d26
Collecting …Run Code Online (Sandbox Code Playgroud) 我使用 alpine 3.5 作为基础镜像制作了一个 docker 镜像。我希望在容器内运行的 php 应用程序与 redis 服务器进行通信。但我在 Alpine 中找不到任何 php7-redis 客户端。
有解决方法吗?我尝试使用 pecl 安装 redis,但 alpine 中没有 pecl 包。我尝试使用 pear 但 pear 没有 redis 包。关于这个问题的任何想法?
我的多阶段构建/assets/css在需要复制时找不到目录。我需要改变什么?
版本 17.06.0-ce-mac17 (18432)
通道:边缘
4bb7a7dfa0
FROM ruby:2.4.1-slim
RUN mkdir /assets
VOLUME /assets
RUN gem install sass
ENTRYPOINT ["sass"]
Run Code Online (Sandbox Code Playgroud)
请注意我在第一个图像上运行的调试命令cd /assets/css && ls && pwd,结果显示在构建阶段。
# Compile Sass
FROM myimage/sass AS builder
COPY app/assets/sass /assets/sass
RUN sass --update --force --sourcemap=none --stop-on-error /assets/sass:/assets/css &&\
# sass directory isn't needed
rm -r assets/sass &&\
# debugging: check /assets/css exists inside the container
cd /assets/css && ls && pwd
FROM alpine:3.6
WORKDIR /app
RUN …Run Code Online (Sandbox Code Playgroud) 我正在尝试在dind:latest基于 alpine的图像中安装 azure-cli 。
对于上下文,我想使用它连接到 AKS 并通过 Gitlab 将应用程序部署到 Kubernetes。
在我的gitlab-ci.yml文件中,我从这个开始
image: docker:latest
services:
- docker:dind
Run Code Online (Sandbox Code Playgroud)
然后我尝试安装 azure-cli
deploy-to-k8s--dev: # k8s namespace "dev"
stage: deploy-to-k8s
# image: microsoft/azure-cli
script:
# I need the azure cli in the dind:latest container
# so install bash,curl and finally the cli
- apk update
- apk upgrade
- apk add bash
- apk add --no-cache curl
- curl -L https://aka.ms/InstallAzureCli | bash
- az
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
$ curl -L https://aka.ms/InstallAzureCli | …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建基于 的 docker 映像alpine:3.7,但是在使用apk add.
例子:
ERROR: unsatisfiable constraints:
apache2-suexec (missing):
required by: world[apache2-suexec-custom]
host (missing):
required by: world[host]
lpr (missing):
required by: world[lpr]
time (missing):
required by: world[time]
Run Code Online (Sandbox Code Playgroud)
原因是这些包在 alpine 存储库中还不存在。我该如何解决这些问题?有没有我可以下载它们的存储库?
我正在使用这条线
FROM alpine:3.7
RUN apk update \
&& apk upgrade \
&& apk --no-cache add --update tcl apache2 apache2-suexec ca-certificates \
apk-tools curl build-base supervisor lpr time dcron host rsync libxml2-utils libxslt
Run Code Online (Sandbox Code Playgroud) 我正在 CircleCI 上构建一个简单的 CI 流程。它 Dockerises 一个 WordPress 实例,确定远程注册表是否有结果镜像的副本,如果没有,以特殊格式标记镜像并推送它。
但是,我在实践中发现图像总是不同的,并且我已经将问题直接追溯到 Dockerfile 的顶部,我在那里调用了 Alpine 的apk命令。完整的命令是:
RUN apk --update add git openssh-client
Run Code Online (Sandbox Code Playgroud)
我已经完成了两个相隔大约 20 分钟的构建,并且这个命令在每种情况下都在做一些不同的事情。我开始使用 Alpine 3.6 中的固定哈希。
这是倒数第二个版本的前几行:
Step 1/42 : FROM alpine@sha256:3d44fa76c2c83ed9296e4508b436ff583397cac0f4bad85c2b4ecc193ddb5106 AS build
sha256:3d44fa76c2c83ed9296e4508b436ff583397cac0f4bad85c2b4ecc193ddb5106: Pulling from library/alpine
Digest: sha256:3d44fa76c2c83ed9296e4508b436ff583397cac0f4bad85c2b4ecc193ddb5106
Status: Downloaded newer image for alpine@sha256:3d44fa76c2c83ed9296e4508b436ff583397cac0f4bad85c2b4ecc193ddb5106
---> 77144d8c6bdc
Step 2/42 : RUN apk --update add git openssh-client
---> Running in 4dee205378ad
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/8) Installing ca-certificates (20161130-r2)
(2/8) Installing libssh2 (1.8.0-r1)
(3/8) Installing libcurl …Run Code Online (Sandbox Code Playgroud) 使用 python 安装最新的 alpine ( 3.8 ) 后,出现以下错误
$ docker run -it alpine:3.8 sh
/ # sed -i -e 's/v[[:digit:]]\.[[:digit:]]/edge/g' /etc/apk/repositories
/ # apk add python3
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/11) Installing libbz2 (1.0.6-r6)
(2/11) Installing expat (2.2.6-r0)
(3/11) Installing libffi (3.2.1-r5)
(4/11) Installing gdbm (1.13-r1)
(5/11) Installing xz-libs (5.2.4-r0)
(6/11) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(7/11) Installing ncurses-terminfo (6.1_p20180818-r1)
(8/11) Installing ncurses-libs (6.1_p20180818-r1)
(9/11) Installing readline (7.0.003-r1)
(10/11) Installing sqlite-libs (3.24.0-r1)
(11/11) Installing python3 (3.6.6-r2)
Executing busybox-1.28.4-r1.trigger
OK: 67 MiB in …Run Code Online (Sandbox Code Playgroud) 看到这个github问题:https : //github.com/grpc/grpc/issues/18338
请参阅此示例存储库:https : //github.com/slolife/alpine-protoc
如果我在项目中包含Grpc.Tools 1.19.0 nuget 包,则会添加一个构建步骤<Protobuf Include="Test.proto" />
如果我创建一个 docker 镜像来构建并使用它microsoft/dotnet:2.2-sdk作为构建镜像,这很好用。但是,如果我尝试使用基于 alpine 的microsoft/dotnet:2.2-sdk-alpine构建映像,构建将失败并显示以下错误消息:
/root/.nuget/packages/grpc.tools/1.19.0/build/_protobuf/Google.Protobuf.Tools.targets(263,5): error MSB6003: The specified task executable "/root/.nuget/packages/grpc.tools/1.19.0/tools/linux_x64/protoc" could not be run. No such file or directory [/src/alpine-protoc.csproj]
我确认该protoc文件位于错误消息所抱怨的位置。
我尝试运行apk add libc6-compat并重新运行构建。这次我收到以下错误:
/root/.nuget/packages/grpc.tools/1.19.0/build/_protobuf/Google.Protobuf.Tools.targets(263,5): error MSB6006
: "/root/.nuget/packages/grpc.tools/1.19.0/tools/linux_x64/protoc" exited with code 139. [/src/alpine-proto
c.csproj]
更新:输出来自 ldd protoc
~/.nuget/packages/grpc.tools/1.19.0/tools/linux_x64 # ldd protoc
/lib64/ld-linux-x86-64.so.2 (0x7f60935a7000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f60935a7000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f60935a7000)
libc.so.6 …Run Code Online (Sandbox Code Playgroud) 我需要一个基于 nginx:alpine 的 Docker 容器从端口 8080 提供 http 内容,但 nginx:alpine 默认监听端口 80。
构建自定义容器时如何更改端口?
alpine-linux ×10
docker ×6
.net-core ×1
azure-cli ×1
build ×1
containers ×1
dockerfile ×1
gcc ×1
grpc ×1
http ×1
kubernetes ×1
linux ×1
nginx ×1
php-7 ×1
pylint ×1
python ×1
python-3.x ×1
redis ×1