标签: alpine-linux

无法从alpine linux容器中运行jfrog可执行文件

我使用的alpine linux容器,特别python:3.4-alpineopenjdk:8-jdk-alpine.当我尝试执行我放在可执行文件中的任何脚本或可执行文件时,我收到Not Found错误.

例如.在python:3.4-alpine我想要安装的容器中,jfrog我按照这里的命令(在我curl通过apk 安装后).此命令下载shell脚本并将其管道到sh,下载并创建jfrog具有正确权限的可执行文件.当我试图运行这个可执行文件时,我得到了

bin/sh:./ jfrog:找不到

更新

我发现root用户bin/ash默认使用,我不知道它是什么.所以我bin/sh jfrog手动调用了,我得到了

/ #bin/sh jfrog jfrog:第1行:ELF:找不到jfrog:第1行:语法错误:未终止的引用字符串

知道我做错了什么吗?我怀疑它只与容器中存在的root用户有关.

docker alpine-linux jfrog-mission-control

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

在Alpine Linux上的python上安装snappy时出现问题

当我尝试使用以下方法在高山linux上安装Snappy时:pip install snappy当我尝试安装名为cypari的必需软件包时,出现以下错误。

我从“ apk add snappy”安装了snappy

    gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -fPIC -Ilibcache/pari64/include -I/usr/include/python2.7 -c cypari_src/_pari.c -o build/temp.linux-x86_64-2.7/cypari_src/_pari.o
In file included from cypari_src/_pari.c:460:0:
cypari_src/implementation.c:47:22: fatal error: execinfo.h: No such file or directory
 #include <execinfo.h>
Run Code Online (Sandbox Code Playgroud)

python linux pip snappy alpine-linux

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

/bin/bash: 在 alpine docker 中找不到命令

我正在尝试Makefilealpinedocker 中运行它。

SHELL := /bin/bash

build:
    GOOS=linux go build -o bin/server main.go
Run Code Online (Sandbox Code Playgroud)

我已经确定,这两个bashmakego在那里通过交互进入容器中,并检查所有的命令。

但是这个命令神秘地失败了:

+ make build
make: /bin/bash: Command not found
GOOS=linux go build -o bin/server main.go
make: /bin/bash: Command not found
make: *** [Makefile:17: build] Error 127
script returned exit code 2
Run Code Online (Sandbox Code Playgroud)

我真的很难调试它,因为它在 docker 中并且jenkins正在执行所有内容。

bash makefile jenkins docker alpine-linux

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

高山Linux如何在x86_64体系结构上安装x86软件包

我正在尝试在官方的高山docker映像上安装32位软件包,但是apk add libcurl例如,每当我这样做时,它都会安装64位版本的libcurl,而我想安装32位软件包。有什么想法在Alpine Linux 3.7上怎么做?

docker alpine-linux

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

Docker Alpine linux运行2个程序

我正在尝试使用alpine linux创建docker镜像,在运行之后将创建具有2个正在运行的程序的容器.这个2(在我看来 - 我不太熟悉docker)无法分开,因为第一个程序更改了秒配置文件,然后也应该重新启动该程序.

我正在努力如何运行这两个程序.我已经添加了自己的脚本,应该运行该程序,但我遗漏了一些东西 - 脚本是每行2行是运行该程序的命令 - 它只启动第一个程序.

在使用python subprocess和systemctl命令的ubuntu中,我重新启动运行服务,但在alpine linux中,它作为程序运行,我不知道如何重新启动/重新加载它.

谢谢你的帮助

python ash docker alpine-linux

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

如何将php gd扩展名添加到Dockerfile

尝试使用Alpine进行部署时出现此错误:

phpoffice/phpspreadsheet 1.2.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
Run Code Online (Sandbox Code Playgroud)

这是我的Dockerfile:

FROM php:7.2-alpine

RUN apk update
RUN apk add zlib-dev gd php7-gd
RUN docker-php-ext-install sockets pdo_mysql zip
RUN apk add --no-cache libpng libpng-dev && docker-php-ext-install gd
Run Code Online (Sandbox Code Playgroud)

错误是詹金斯跑步的输出。我认为这里附近某处失败了...

build:
    docker run --rm --tty --user $$(id -u):$$(id -g) \
        --volume "$$(pwd)":/app \
        --volume "$$(pwd)/ops/jenkins/github.token":/tmp/auth.json \
        --volume "$$(pwd)/ops/jenkins/composer_trust_github.com":/root/.ssh/config \
        composer install --no-dev
    rm -rf ops/docker/app.tar.gz
    tar -czvf ops/docker/app.tar.gz -X ops/jenkins/build_excludes .

docker run --rm --tty --user …
Run Code Online (Sandbox Code Playgroud)

php-extension php-gd docker alpine-linux

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

如何在Alpine Linux容器上安装pyzmq?

我有一个带有python:3.6-alpine内核的容器,我在用pip安装pyzmq时遇到问题:

Dockerfile:

FROM python:3.6-alpine

RUN mkdir /code
RUN apk add vim
WORKDIR /
ADD . /code
Run Code Online (Sandbox Code Playgroud)

docker-compose.yml:

version: '3'

services:
  battery_monitoring:
      build: .
      image: bm:1.0.0
      container_name: battery_monitoring
      restart: unless-stopped
      volumes:
        - .:/code
      tty: true
Run Code Online (Sandbox Code Playgroud)

当我在此容器上安装几个Python库时,我没有任何问题,但是在pyzmq库中,出现错误:

程序:

$ docker-compose build
$ docker-compose up -d
$ docker exec -it <This-container-ID> sh
Run Code Online (Sandbox Code Playgroud)

在容器中:

pip install pyserial
pip install easydict
Run Code Online (Sandbox Code Playgroud)

上面的命令也安装了,但是在pyzmq安装中,我遇到了以下错误:

pip install pyzmq
Run Code Online (Sandbox Code Playgroud)

结果的一部分:

    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-545my4q5/pyzmq/setup.py';f=getattr(tokenize, 'open', …
Run Code Online (Sandbox Code Playgroud)

pip python-3.x pyzmq docker alpine-linux

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

Docker:Alpine Linux:为什么apk add &lt;package&gt;在容器中持久存在?

晚上好。

我们已经了解到Docker容器是无状态的,但是看起来Alpine Linux容器违反了以下规则:

  1. 我们使用以下命令启动Alpine Linux容器 docker run <containername> -it /bin/sh
  2. 我们安装缺少的nano编辑器: apk add nano

如果我们现在停止并启动此容器,它仍然知道nano编辑器。

这是Alpine Linux中的一项特殊功能,还是听起来像我们的Docker主机做了一些奇怪的事情?

非常感谢您的帮助!亲切的问候,
托马斯。

docker alpine-linux

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

高山编译中的Gdal安装失败-“错误:命令'gcc'失败,退出状态为1”

我正在尝试在Alpine docker env中安装Gdal。我安装了Gdal的依赖项,一切顺利

RUN apk add --no-cache gcc build-base /gdal/gdal-dev-2.4.0-r1.apk /gdal/gdal-2.4.0-r1.apk /gdal/geos-3.7.1-r0.apk /gdal/libcrypto1.1-1.1.1b-r1.apk
Run Code Online (Sandbox Code Playgroud)

然后,我运行命令“ "pip install gdal" 下载”,GDAL-3.0.0.tar.gz但安装时最终出现错误。

修剪后的原木;

Building wheels for collected packages: gdal
  Building wheel for gdal (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-hlldvrpz/gdal/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-dj2y5pji --python-tag cp37:
  ERROR: WARNING: numpy not available!  Array support will not be enabled
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  copying gdal.py -> build/lib.linux-x86_64-3.7 …
Run Code Online (Sandbox Code Playgroud)

gcc gdal docker alpine-linux

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

C python扩展中的分段错误

我正在为python3.7写一个C扩展模块。我有一个简单的结构作为PyObject:

typedef struct {
    PyObject_HEAD
    double attacker;
    double victim;
    double game_hardness;
    int inflation;
} RatingSystem;
Run Code Online (Sandbox Code Playgroud)

和初始化器:

static int 
RatingSystem_init(RatingSystem *self, PyObject *args, PyObject *kwargs) {
    double kek;
    static char *kwargs_list[] = {"attacker", "victim", "game_hardness", "inflation"};
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|$dddi", kwargs_list,
                                      &self->attacker, &self->victim,
                                      &self->game_hardness, &self->inflation)) {
        return -1;
    }

    printf("Success\n");
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

如果我在python 3.7.3下的Mac OS上运行它,一切正常,但是如果我切换到alpine 3.10 python docker image(python:3.7-alpine),请执行以下初始化:

import rating_system
rs = rating_system.RatingSystem(attacker=1000.0, victim=1000.0, game_hardness=1300.0, inflation=1)
Run Code Online (Sandbox Code Playgroud)

我懂了Segmentation fault。在gdb下运行显示以下内容:

Program received signal SIGSEGV, Segmentation fault.
vgetargskeywords (args=0x7f87284f0050, kwargs=0x7f87284e0a00, …
Run Code Online (Sandbox Code Playgroud)

c python python-extensions docker alpine-linux

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