我们有基于 alpine linux 的 docker 文件。我想让构建的容器检查musl库的版本,我的意思是运行容器并在 RT 中检查 musl 版本,我该怎么做?
我尝试过类似的东西
docker run -it --rm alpine /bin/ash
Run Code Online (Sandbox Code Playgroud)
并运行
musl -v
Run Code Online (Sandbox Code Playgroud)
得到
/bin/ash: musl: not found
Run Code Online (Sandbox Code Playgroud) I am building my dockerfile using Redhat UBI image, and when I build the image I get the wget: unable to resolve host address'github.com'.
I have tried adding a different URL that does not start with GitHub and that works. Not sure what the problem is.
Below are the errors logs i get when i build the docker file with : wget: unable to resolve host address 'github.com'
Step 11/25 : RUN set -ex; apk update; apk add -f acl …Run Code Online (Sandbox Code Playgroud) 我刚刚开始使用 Docker,我正在尝试使用 php:7.4-alpine 映像运行 ZF2 项目,这是我当前拥有的 Dockerfile
FROM php:7.4-alpine
ENV APACHE_DOCUMENT_ROOT /var/www/app/public
COPY ./src /var/www/app
RUN apk add --no-cache \
apache2 \
php-apache2 \
zlib-dev \
icu-dev \
libpng-dev \
composer
RUN docker-php-ext-install \
gd \
intl \
mysqli \
pdo_mysql \
iconv
RUN chmod -R 775 /var/www/app
RUN chown -R www-data:www-data /var/www/app
RUN cd /var/www/app && composer install
COPY ./apache /etc/apache2
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
Run Code Online (Sandbox Code Playgroud)
(我使用多个 RUN 只是为了在构建时加快速度,我将在生产中更改它)
问题是,我只收到 500 错误,日志显示了这一点
PHP Fatal error: Uncaught Error: Class 'Locale' not found …Run Code Online (Sandbox Code Playgroud) 我有一个Dockerfile由许多服务使用的基础,如下所示:
FROM adoptopenjdk/openjdk11:jdk-11.0.11_9-alpine-slim
Run Code Online (Sandbox Code Playgroud)
Linux Alpine有一些安全修复程序,我想将它们包含在我的基础映像中。在AdoptOpenJDK 的官方页面上寻找新图像时,我发现这些标签自 2021 年 8 月 1 日起已被弃用,取而代之的是Eclipse Temurin项目。
Eclipse Temurin 没有基于 alpine 的 jdk11 镜像。难道我...
参考:
自从昨天最新的 php fpm docker 镜像更新(https://hub.docker.com/_/php?tab=tags&page=1&name=fpm-alpine)以来,我的管道已损坏,因为显然安装了 PHP 版本 8 而不是 7.4我指定的 Dockerfile。
我在我的 docker 文件中使用它:
FROM php:7.4-fpm-alpine AS ...
Run Code Online (Sandbox Code Playgroud)
但根据我的作曲家安装的容器,PHP 8.0.13正在运行:
Root composer.json requires php 7.4.26 but your php version (8.0.13) does not satisfy that requirement.
Run Code Online (Sandbox Code Playgroud)
有人知道这里发生了什么事吗?
我们有一个解决方案范围的文件夹,其中包含每个项目所需的共享设置。
我正在尝试将该文件夹的内容复制到 /app 文件夹,但它不起作用
这是我的 dockerfile 配置的一部分:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine3.12 AS build
### this is where I'm trying to copy the contents of Shared Settings to /app
WORKDIR '/src/Shared Settings'
COPY '/src/Shared Settings' /app
### this is part of the rest of the docker file, which works fine
WORKDIR /src
COPY . .
WORKDIR /src/OurProject.Server
RUN dotnet restore OurProject.Server.csproj
RUN dotnet build OurProject.Server.csproj -c Release -o /app
Run Code Online (Sandbox Code Playgroud)
我需要更改什么才能将共享设置的内容复制到 Docker 容器中的 /app 文件夹?
我有一个使用ruby:2.7.1-alpine基础镜像的 Dockerfile。我有一个需要的 gem libcurl,但在 Alpine 映像上安装时遇到问题。我在与上述 gem 相关的GitHub 问题上看到了一个解决方案。但该解决方案假定基于 Debian 的操作系统,其中提到安装libcurl4-openssl-dev. 我需要的是 Alpine 上这个包的等价物。
我正在使用 alpine 作为基础映像创建一个 docker 容器,并使用以下命令创建了一个用户:
RUN adduser -u 5532 -s /bin/tcsh -D userA
并且我已经将几个组定义为
RUN addgroup --gid 2076 groupA && \
addgroup --gid 2077 groupB && \
addgroup --gid 400 groupC
Run Code Online (Sandbox Code Playgroud)
我无法使用adduser命令将创建的用户分配给多个组。如果我有多个adduser命令/指令,我会收到错误user userA is in use。请让我知道如何将特定用户分配到 alpine linux 中的多个组。
完全的Dockerfile
FROM python:alpine3.16
RUN adduser -u 5532 -s /bin/tcsh -D userA
RUN addgroup --gid 2076 groupA && \
addgroup --gid 2077 groupB && \
addgroup --gid 400 groupC
Run Code Online (Sandbox Code Playgroud) 鉴于此Dockerfile:
FROM alpine:3.7
ENV LAST_UPDATED=2018-02-22
ARG XDG_CACHE_HOME=/tmp/cache/
RUN apk update && \
apk add libxslt && \
apk add sed && \
apk add py-pip && \
apk add mariadb-client && \
apk add bash bash-doc bash-completion && \
pip install httpie && \
rm -rf /var/cache/apk/*
WORKDIR /usr/deleter/
COPY delete.sh ./
ENTRYPOINT ["/usr/deleter/delete.sh"]
Run Code Online (Sandbox Code Playgroud)
我希望能够通过.env具有该key=value格式的文件传递多个变量.
$ cat stage.env
MYSQL_DATABASE=database
MYSQL_HOST=127.0.0.1:3306
MYSQL_PASSWORD=password
MYSQL_PORT=3306
MYSQL_USER=a_user
Run Code Online (Sandbox Code Playgroud)
我的delete.sh唯一看起来像这样:
#!/bin/bash
set -e
set -o pipefail
echo "hello world"
echo …Run Code Online (Sandbox Code Playgroud) 在尝试使用Alpine Linux运行E2E测试时,我们遇到以下神秘错误:
E/launcher - spawn (...)/selenium/chromedriver_2.40 ENOENT
Run Code Online (Sandbox Code Playgroud)
如何繁殖
docker run -it --name my-alpine --rm alpine:latest /bin/ash
apk add --update nodejs nodejs-npm chromium \
&& export CHROME_BIN=/usr/bin/chromium-browser
npm install -g @angular/cli
ng new testAlpine
cd testAlpine
ng e2e
Run Code Online (Sandbox Code Playgroud)
结果
[14:10:54] I/file_manager - creating folder /testAlpine/node_modules/protractor/node_modules/webdriver-manager/selenium
? ?wdm?: Compiled successfully.
[14:10:54] I/update - chromedriver: unzipping chromedriver_2.40.zip
[14:10:55] I/update - chromedriver: setting permissions to 0755 for /testAlpine/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.40
(node:121) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[14:10:55] I/launcher - Running 1 …Run Code Online (Sandbox Code Playgroud) alpine-linux ×10
docker ×8
dockerfile ×4
php ×2
.net ×1
.net-core ×1
angular ×1
c ×1
docker-image ×1
eclipse ×1
java ×1
linux ×1
musl ×1
openjdk-11 ×1
protractor ×1
redhat ×1