alpine

How to get /etc/profile to run automatically in Alpine / Docker

☆樱花仙子☆ 提交于 2019-11-30 00:09:25
How can I get /etc/profile to run automatically when starting an Alpine Docker container interactively? I have added some aliases to an aliases.sh file and placed it in /etc/profile.d , but when I start the container using docker run -it [my_container] sh , my aliases aren't active. I have to manually type . /etc/profile from the command line each time. Is there some other configuration necessary to get /etc/profile to run at login? I've also had problems with using a ~/.profile file. Any insight is appreciated! EDIT: Based on VonC's answer, I pulled and ran his example ruby container. Here is

What is .build-deps for apk add --virtual command?

旧城冷巷雨未停 提交于 2019-11-29 20:47:52
What is .build-deps in the following command? I can't find an explanation in the Alpine docs. Is this a file that is predefined? Is see this referenced in many Dockerfiles. RUN apk add --no-cache --virtual .build-deps \ gcc \ freetype-dev \ musl-dev RUN pip install --no-cache-dir <packages_that_require_gcc...> \ RUN apk del .build-deps Tarun Lalwani If you see the documentation -t, --virtual NAME Instead of adding all the packages to 'world', create a new virtual package with the listed dependencies and add that to 'world'; the actions of the command are easily reverted by deleting the virtual

Java 11 application as lightweight docker image

試著忘記壹切 提交于 2019-11-29 19:26:46
Inspired by question Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim) I found that this topic in Java world is still not settled. As for 07 Dec 2018 there are common issues/pitfalls (discussed in the ticket above): JRE is not distributed as a separate "package". Modules from JDK should be used instead Oracle OpenJDK 11 doesn't support Linux Alpine , so lightweight images can't be easily created In the same time current stable Debian versions still doesn't have Java 11 packages ( Ubuntu has Java 10 installed under openjdk-11 packages), that's why unstable sid versions are

Installed Go binary not found in path on Alpine Linux Docker

末鹿安然 提交于 2019-11-29 19:05:56
I've got a Go binary I'm trying to run on the Alpine Docker image. This works fine for the Docker Go binary. docker run -it alpine:3.3 sh apk add --no-cache curl DOCKER_BUCKET=get.docker.com DOCKER_VERSION=1.9.1 curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" -o /usr/local/bin/docker chmod +x /usr/local/bin/docker docker help Usage: docker [OPTIONS] COMMAND [arg...] ... However, for the Go binary I want to install. RACK_BUCKET=ec4a542dbf90c03b9f75-b342aba65414ad802720b41e8159cf45.ssl.cf5.rackcdn.com RACK_VERSION=1.1.0-beta1 curl -fSL "https://${RACK_BUCKET}/$

How to use bash with an Alpine based docker image?

孤街浪徒 提交于 2019-11-29 18:49:55
I created a docker image from openjdk:8-jdk-alpine but when I try to execute simple commands I get the following errors: RUN bash /bin/sh: bash: not found RUN ./gradlew build env: can't execute 'bash': No such file or directory Alpine docker image doesn't have bash installed by default. You will need to add following commands to get bash : RUN apk update && apk add bash If youre using Alpine 3.3+ then you can just do RUN apk add --no-cache bash to keep docker image size small. (Thanks to comment from @sprkysnrky) Try using RUN /bin/sh instead of bash. RUN /bin/sh -c "apk add --no-cache bash"

How to bake credential into docker image for git?

浪子不回头ぞ 提交于 2019-11-29 11:32:36
This is actually a question following from my previous one . I am trying to use docker to host a personal note-taking web service and want to backup data generated by the service (my notes). Currently I plan to use git to commit, pull, and push to a repository for my purpose. To do git pull and push, my docker image needs to host my credentials. What is the easiest yet safe way to achieve this? What I have done so far: I choose Alpine as the base image of the image of my service. Because I only need credentials for git, I think put a git credential helper into the image may solve my problem. I

How to get /etc/profile to run automatically in Alpine / Docker

爱⌒轻易说出口 提交于 2019-11-28 21:04:43
问题 How can I get /etc/profile to run automatically when starting an Alpine Docker container interactively? I have added some aliases to an aliases.sh file and placed it in /etc/profile.d , but when I start the container using docker run -it [my_container] sh , my aliases aren't active. I have to manually type . /etc/profile from the command line each time. Is there some other configuration necessary to get /etc/profile to run at login? I've also had problems with using a ~/.profile file. Any

Is there a best practice on setting up glibc on docker alpine linux base image?

我与影子孤独终老i 提交于 2019-11-28 20:17:14
Is there a best practice on setting up glibc on docker alpine linux base image with correct paths so any spawned process can correctly reference the location of the installed libc libraries? Yes there is, I've used a custom built glibc to install a JRE on it. You can find it here You can use wget or curl to get the code and apk to install them UPDATED commands see comments below apk --no-cache add ca-certificates wget wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28

Why does it take ages to install Pandas on Alpine Linux

戏子无情 提交于 2019-11-28 17:11:06
I've noticed that installing Pandas and Numpy (it's dependency) in a Docker container using the base OS Alpine vs. CentOS or Debian takes much longer. I created a little test below to demonstrate the time difference. Aside from the few seconds Alpine takes to update and download the build dependencies to install Pandas and Numpy, why does the setup.py take around 70x more time than on Debian install? Is there any way to speed up the install using Alpine as the base image or is there another base image of comparable size to Alpine that is better to use for packages like Pandas and Numpy?

Java 11 application as lightweight docker image

时光怂恿深爱的人放手 提交于 2019-11-28 14:37:03
问题 Inspired by question Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim) I found that this topic in Java world is still not settled. As for 07 Dec 2018 there are common issues/pitfalls (discussed in the ticket above): JRE is not distributed as a separate "package". Modules from JDK should be used instead Oracle OpenJDK 11 doesn't support Linux Alpine, so lightweight images can't be easily created In the same time current stable Debian versions still doesn't have Java 11