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

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-r0.apk apk add glibc-2.28-r0.apk … Read more

Java 11 application as lightweight docker image

UPD from 07.2019: https://stackoverflow.com/a/57145029/907576 Taking as an example of simple spring boot application (with only one REST endpoint) so far i was able to figure out the following solutions (considering application jar is located at build/libs/spring-boot-demo.jar before Docker build: Jedi path if we want to use official Oracle OpenJDK distribution on stable slim Linux version … Read more

Installing OpenSSH on the Alpine Docker Container

Run apk update first. The below paste contains a complete example: ole@T:~$ docker run -it –rm alpine /bin/ash / # apk update fetch http://dl-4.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz fetch http://dl-4.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz v3.3.1-97-g109077d [http://dl-4.alpinelinux.org/alpine/v3.3/main] v3.3.1-59-g48b0368 [http://dl-4.alpinelinux.org/alpine/v3.3/community] OK: 5853 distinct packages available / # apk add openssh (1/3) Installing openssh-client (7.1_p2-r0) (2/3) Installing openssh-sftp-server (7.1_p2-r0) (3/3) Installing openssh (7.1_p2-r0) Executing busybox-1.24.1-r7.trigger OK: … Read more

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

You can use the nsenter command to run a command on your host inside the network namespace of the Docker container. Just get the PID of your Docker container: docker inspect -f ‘{{.State.Pid}}’ container_name_or_id For example, on my system: $ docker inspect -f ‘{{.State.Pid}}’ c70b53d98466 15652 And once you have the PID, use that as … Read more

Go-compiled binary won’t run in an alpine docker container on Ubuntu host

By default, if using the net package a build will likely produce a binary with some dynamic linking, e.g. to libc. You can inspect dynamically vs. statically link by viewing the result of ldd output.bin There are two solutions I’ve come across: Disable CGO, via CGO_ENABLED=0 Force the use of the Go implementation of net … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)