What is the point of the BusyBox docker image?

A Busybox docker image is useful if one is building a container for which busybox can fulfill its dependency chain without needing a full Linux distro. Often, an embedded appliance can consist of nothing but a statically-linked copy of busybox, an init script that mounts procfs, sysfs, &c. with busybox-provided tools, and then the actual … Read more

How to run amd64 docker image on arm64 host platform?

Using –platform is correct. On my M1 Mac I’m able to run both arm64 and amd64 versions of the Ubuntu image from Docker Hub. The machine hardware name provided by uname proves it. # docker run –rm -ti –platform linux/arm/v7 ubuntu:latest uname -m armv7l # docker run –rm -ti –platform linux/amd64 ubuntu:latest uname -m x86_64 … Read more

How to install OpenSSH on Alpine?

Run apk update first. 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: 8 MiB in 14 … Read more

What’s the difference between “docker run -v …” volume and Dockerfile VOLUME?

The VOLUME command will mount a directory inside your container and store any files created or edited inside that directory on your hosts disk outside the container file structure, bypassing the union file system. The idea is that your volumes can be shared between your docker containers and they will stay around as long as … Read more

How do I set environment variables during the “docker build” process?

ARG is for setting environment variables which are used during the docker build process – they are not present in the final image, which is why you don’t see them when you use docker run. You use ARG for settings that are only relevant when the image is being built, and aren’t needed by containers … Read more

How can I run bash in a docker container?

If you docker run without attaching a tty, and only call bash, then bash finds nothing to do, and it exits. That’s because by default, a container is non-interactive, and a shell that runs in non-interactive mode expects a script to run. Absent that, it will exit. To run a disposable new container, you can … Read more

Why doesn’t Python app print anything when run in a detached docker container?

Finally I found a solution to see Python output when running daemonized in Docker, thanks to @ahmetalpbalkan over at GitHub. Answering it here myself for further reference : Using unbuffered output with CMD [“python”,”-u”,”main.py”] instead of CMD [“python”,”main.py”] solves the problem; you can see the output now (both, stderr and stdout) via docker logs myapp … Read more

How to get an environment variable value into Dockerfile during “docker build”?

You should use the ARG directive in your Dockerfile which is meant for this purpose. The ARG instruction defines a variable that users can pass at build-time to the builder with the docker build command using the –build-arg <varname>=<value> flag. So your Dockerfile will have this line: ARG request_domain or if you’d prefer a default … Read more

How to make Docker container see real user IP?

Finally, answering my own question. After some research I have found that it was IP masquerading that caused Docker to recognize client addresses incorrectly. The cause In my case, firewalld is configured to share internet connection with other machines in local network. This is accomplished by setting zone to public for the external interface (enp3s0) … Read more

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