我想在 alpine docker 容器中安装 gRPC cpp 库。 这是我在 alpine:edge 中找到 gRPC 包的地方。但是,当我尝试做
apk update && apk add --no-cache grpc
Run Code Online (Sandbox Code Playgroud)
from alpine:edge,但它给了我:
错误:
无法满足的约束:grpc(缺失):
需要:world[grpc]
我错过了任何一步吗?
我想构建一个docker镜像。我跑
docker build --build-arg project_file_name=account.jar -t account:1.0 .
Run Code Online (Sandbox Code Playgroud)
docker 文件如下所示(#1)
FROM anapsix/alpine-java:8u172b11_server-jre
ARG project_file_name
MAINTAINER jim
COPY src/${project_file_name} /home/${project_file_name}
CMD java -jar /home/${project_file_name}
Run Code Online (Sandbox Code Playgroud)
如果对变量进行硬编码,它将如下所示(#2)
FROM anapsix/alpine-java:8u172b11_server-jre
MAINTAINER jim
enter code here
COPY src/account.jar /home/account.jar
CMD java -jar /home/account.jar
Run Code Online (Sandbox Code Playgroud)
在我用 #1 和 #2 构建图像之后
使用 #1,当我运行 docker 时,docker 告诉我它找不到指定的 jar 文件
使用#2,当我运行 docker 时,docker 能够正确执行 java jar 文件。
对我来说#1 和#2 都是一样的。只是 #1 使用 build-arg 变量方式,#2 是硬编码值。我相信我使用 build-args 的方式是不正确的。任何人都可以指导我吗?
问候
我正在尝试在我的 docker 高山映像中安装 R。早些时候我确实使用
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 \ && add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/' \
&& apt-get update \ && apt-get install -y r-base
我无处可找到如何在 alpine 中安装它。任何帮助,将不胜感激。
我的基本图像是 python:3.7-alpine
我需要npm rebuild node-sass --force在我的 docker 容器内运行
但是我遇到了一个错误(即使在我已经安装了 python 之后)
Error: Can't find Python executable "python", you can set the PYTHON env variable.
Run Code Online (Sandbox Code Playgroud)
这是我的 Dockerfile
FROM node:8.16.0-alpine
RUN mkdir /app
WORKDIR /app
# --no-cache: download package index on-the-fly, no need to cleanup afterwards
# --virtual: bundle packages, remove whole bundle at once, when done
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++ \
bash \
&& npm install \
&& apk del build-dependencies
RUN npm …Run Code Online (Sandbox Code Playgroud) 在 Alpine Linux 3.10 上运行,我已经git使用apk.
在现有的结帐目录中,当我尝试启动git add的交互模式时:
$ git add -i
Run Code Online (Sandbox Code Playgroud)
我收到错误:
git: 'add--interactive' is not a git command. See 'git --help'.
Run Code Online (Sandbox Code Playgroud)
的git add帮助表示-i是一个有效的选项。
怎么了?
好的,所以任务看起来很简单!使用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) 我收到错误:
theme_precmd:1: vcs_info: function definition file not found
当在 oh-my-zsh 上安装和使用主题时,这适用于 Unix (alpine)。
不知道去哪里,因为到目前为止搜索互联网并没有帮助。任何想法都会很棒。
我.zshrc的如下:
cat ~/.zshrc [19:02:55]
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# ZSH_DISABLE_COMPFIX="true"
# Path to your oh-my-zsh installation.
export ZSH="/root/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用基于 alpine 的操作系统构建 cassandra docker 镜像。在容器运行过程中,我遇到了与权限相关的问题,因为我以 cassandra 用户身份运行。我无法运行 sudo 并将我的用户 cassandra 切换为 sudo 用户。下面是我的示例 docker 文件,仅显示与 sudo 用户相关的逻辑--
FROM alpine:latest
RUN apk --no-cache update \
&& apk --no-cache add sudo
copy run.sh /usr/local/
RUN addgroup -S cassandra && adduser -S cassandra -G cassandra
RUN chown -R cassandra:cassandra /home/cassandra/
RUN echo 'cassandra ALL=(ALL) /bin/su' >> /etc/sudoers
USER cassandra
ENTRYPOINT [ "sh","/usr/local/run.sh"]
Run Code Online (Sandbox Code Playgroud)
登录容器后,我无法执行任何与 sudo 相关的任务。
我正在尝试在 alpine docker 上从源代码安装节点。
wget https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz
tar -xvf node-v14.4.0-linux-x64.tar.xz
一旦我尝试运行它:
~/node-v14.4.0-linux-x64/bin # ./node
sh: ./node: not found
Run Code Online (Sandbox Code Playgroud)
虽然文件在这里,但我有权限并且它是可执行的
~/node-v14.4.0-linux-x64/bin # ls -la
total 70376
drwxr-xr-x 2 root root 4096 Oct 7 11:53 .
drwxr-xr-x 6 1001 1001 4096 Oct 7 11:53 ..
-rwxr-xr-x 1 root root 72052312 Jun 2 14:33 node
lrwxrwxrwx 1 root root 38 Oct 7 11:53 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 root root 38 Oct 7 11:53 npx -> ../lib/node_modules/npm/bin/npx-cli.js
Run Code Online (Sandbox Code Playgroud)
当我在 ubuntu 上执行相同的操作时,它会起作用。
我无法在 alpine docker 镜像上安装 ruby 的 gems。我尝试了解决其他问题的不同方法ERROR: While executing gem ... (Gem::FilePermissionError),但有适用于 Ubuntu 或 Mac OS 的解决方案。
部分docker文件代码:
RUN set -ex \
&& apk add --no-cache --update ruby ruby-dev ruby-bundler \
&& gem install --no-document --source https://rubygems.org --version 3.6.6 inspec
Run Code Online (Sandbox Code Playgroud)
输出:
+ apk add --no-cache --update ruby ruby-dev ruby-bundler
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/11) Installing yaml (0.2.5-r0)
(2/11) Installing ruby-libs (2.7.3-r1)
(3/11) Installing ruby (2.7.3-r1)
(4/11) Installing ruby-etc (2.7.3-r1)
(5/11) Installing ruby-io-console (2.7.3-r1)
(6/11) Installing ruby-bundler (2.2.20-r0)
(7/11) …Run Code Online (Sandbox Code Playgroud) alpine-linux ×10
docker ×7
linux ×2
node.js ×2
build ×1
containers ×1
dockerfile ×1
git ×1
grpc ×1
java ×1
oh-my-zsh ×1
postgis ×1
postgresql ×1
python ×1
r ×1
ruby ×1
sudo ×1
sudoers ×1
zsh ×1