alpine

GCC can't find stdio.h in Alpine Linux

只谈情不闲聊 提交于 2019-12-03 10:33:44
In a fresh Alpine Linux I installed GCC by apk add --update-cache gcc but still a simple program #include <stdio.h> int main(int argc, char *argv[]) { return 0; } compiled with message fatal error: stdio.h: No such file or directory Franklin Yu Install libc-dev in addition to GCC, or just install build-base for everything ( alpine-sdk is probably an overkill). To install run the following command: apk add libc-dev You need to install it separately because in Alpine Linux, the package GCC doesn't depend on libc-dev for good reason : You can use gcc to compile things without libc, for example

Installing OpenSSH on the Alpine Docker Container

大憨熊 提交于 2019-12-03 08:04:19
问题 When running the alpine docker container the first time and attempting an openssh install, the following happens: ole@T:~$ docker run -it --rm alpine /bin/ash / # apk add openssh WARNING: Ignoring APKINDEX.d3812b7e.tar.gz: No such file or directory WARNING: Ignoring APKINDEX.bb2c5760.tar.gz: No such file or directory ERROR: unsatisfiable constraints: openssh (missing): required by: world[openssh] How should openssh be installed? 回答1: Run apk update first. The below paste contains a complete

How to upgrade npm to npm@5 on the latest node docker image?

我是研究僧i 提交于 2019-12-03 05:49:07
Locally, I have successfully installed npm@5 via: $ npm install npm@5 -g $ npm -v $ 5.0.0 And locally, I can run the npm setup just fine (it's basically npm i && tsc ) $ npm run setup updated 102 packages in 3.499s Yet now I also have a Dockerfile based upon the node:7.10-alpine image which breaks if I try to install npm@5 there. My Dockerfile looks like this: FROM node:7.10-alpine WORKDIR /usr/hive-updater/ ENV LAST_UPDATED=2016-12-08 NPM_CONFIG_LOGLEVEL=warn TERM=xterm PATH="$PATH:/usr/hive-updater/node_modules/.bin" RUN npm install npm@5 -g && npm -v COPY ./ ./ RUN npm run setup CMD ["node"

Alpine Add Package from Edge repository

 ̄綄美尐妖づ 提交于 2019-12-03 02:27:12
If I'm using Alpine 3.8, how can I add a specific package from the Alpine Edge repository? Is this even supported? There is no equivalent of backports, from what I can see. I want to add the new version of this: https://pkgs.alpinelinux.org/package/edge/community/armhf/librdkafka And not the older version in the 3.8 repo: https://pkgs.alpinelinux.org/package/v3.8/community/s390x/librdkafka You could specify the exact repo to apk, using the --repository parameter. In your case: apk add librdkafka --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main Edge repository may be enabled

Installing numpy on Docker Alpine

喜夏-厌秋 提交于 2019-12-03 01:21:29
I'm trying to install numpy in a docker container based on Alpine 3.1. I'm using the following Dockerfile: FROM alpine:3.1 RUN apk add --update make cmake gcc g++ gfortran RUN apk add --update python py-pip python-dev RUN pip install cython RUN pip install numpy This runs fine until pip install numpy when I get the following error: error: Command "gcc -fno-strict-aliasing -Os -fomit-frame-pointer -DNDEBUG -Os -fomit-frame-pointer -fPIC -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath

Starting a shell in the Docker Alpine container

╄→尐↘猪︶ㄣ 提交于 2019-12-03 00:28:28
问题 To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var But when this is run for the Alpine Docker image, the following results: ole@T:~$ docker run -it --rm alpine Error response from daemon: No command specified What is the command for starting an interactive shell in an Alpine base container? 回答1: ole@T:~$ docker run -it --rm alpine /bin

Docker: any way to list open sockets inside a running docker container?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 17:16:52
I would like to execute netstat inside a running docker container to see open TCP sockets and their statuses. But, on some of my docker containers, netstat is not available. Is there any way to get open sockets (and their statuses, and which IP addresses they are connected to if any) without using netstat, via some docker API? (BTW, my container uses docker-proxy - that is, not directly bridged) I guess I could look at /proc file system directly, but at that point, I might as well docker cp netstat into the container and execute it. I was wondering if there was any facility that docker might

Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim)

二次信任 提交于 2019-12-02 15:42:15
Java 11 is announced to be the most recent LTS version. So, we're trying to start new services based on this Java version. However, the base Docker image for Java 11 is much larger than the equivalent for Java 8: openjdk:8-jre-alpine : 84 MB openjdk:11-jre-slim : 283 MB (I'm considering only the official OpenJDK and the most lightweight images for each Java version.) Deeper digging uncovered the following "things": the openjdk:11-jre-slim image uses the base image debian:sid-slim . This brings 2 issues: this is 60 MB larger than alpine:3.8 the Debian sid versions are unstable the openjdk-11

Starting a shell in the Docker Alpine container

ⅰ亾dé卋堺 提交于 2019-12-02 14:02:21
To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var But when this is run for the Alpine Docker image , the following results: ole@T:~$ docker run -it --rm alpine Error response from daemon: No command specified What is the command for starting an interactive shell in an Alpine base container? Ole ole@T:~$ docker run -it --rm alpine /bin/ash (inside container) / # Options used above: /bin/ash is Ash ( Almquist Shell ) provided by BusyBox -

GDB failed to load so files and errors No such file or directory

笑着哭i 提交于 2019-12-02 13:27:30
I am loading a core file into GDB inside a docker container with alpine linux. Initially my gdb complained about binary not found, then i followed this discussion gdb During startup program exited with code 127 and installed libc6-compat, even though I have a 64-bit linux and my interpreter for the binary is 64-bit [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] That actually worked but now i get the same error for the .so files. I can see that .so files are in the path set on solib-search-path but gdb did not load any of the libraries and complains No such file or directory.