bocker
s6-overlay
Our great sponsors
bocker | s6-overlay | |
---|---|---|
37 | 27 | |
10,942 | 3,477 | |
- | 1.8% | |
0.0 | 4.6 | |
over 6 years ago | 5 days ago | |
Shell | Shell | |
GNU General Public License v3.0 only | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
bocker
-
Barco: Linux Containers from Scratch in C
When I did a talk about docker I also wanted to show a bit of what it does under the hood without going through all the layers and without too much details. This ~120 lines of shell script is really good in providing just an intro into what's needed for containers: https://github.com/p8952/bocker/blob/master/bocker
- Build Your Own Docker with Linux Namespaces, Cgroups, and Chroot
-
Latest Zen Kernel......
i tried it and like the concnpt, but until it can be launched via a systemd userspace service (without previously manually booting it) among other problems i will keep using docker (or bocker)
-
“Implement DNS in a Weekend”
Bocker is in this same category...docker clone in bash that's helpful in seeing what's really happening underneath with nsenter, namespaces, network bridging, cgroups, etc.
-
Ask HN: What is the best source to learn Docker in 2023?
Docker implemented in around 100 lines of bash: https://github.com/p8952/bocker
This is the most mindblowing example for enterprise security teams that think Docker is a new threat on a single tenant Linux host.
No, buddies, all this stuff is already there. If you were fine with your visibility before*, you're still fine. Go find a real problem while we play with our developer dopamine.
* NARRATOR: They shouldn't have been.
-
Containers are chroot with a Marketing Budget
Bocker[1] does a reasonably good job of showing the value of Docker was mostly in Docker hub.
Surprised no one has mentioned Bocker yet – “Docker implemented in around 100 lines of bash”. [1, 2]
-
Docker implemented in around 100 lines of bash
I was part of this, it was a fun project. I have a final pull request that never made it though, and that's too bad as it addressed some hardcoding issues and added a few helpful commands: https://github.com/p8952/bocker/pull/23
Revisiting the project, it looks like more people tried submitting PRs for the following couple years. Funny, for a project that was definitely an exercise in "do X in 100 lines of code"
s6-overlay
-
Backup Grafana SQLite with Litestream using s6-overlay in a container app
FROM docker.io/grafana/grafana-oss:9.5.12-ubuntu # Set USER to root escalating priviliges to perform installation of litestream and s6-overlay USER root RUN apt-get -qq update && \ apt-get -qq install -y xz-utils \ && rm -rf /var/libs/apt/lists/* # https://github.com/benbjohnson/litestream-s6-example/blob/main/Dockerfile # Download the static build of Litestream directly into the path & make it executable. ADD https://github.com/benbjohnson/litestream/releases/download/v0.3.11/litestream-v0.3.11-linux-amd64.tar.gz /tmp/litestream.tar.gz RUN tar -C / -xvzf /tmp/litestream.tar.gz ARG S6_OVERLAY_VERSION="3.1.5.0" # Download the s6-overlay for process supervision. ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz # Copy s6 init & service definitions. COPY etc/s6-overlay /etc/s6-overlay # Copy Litestream configuration file. COPY etc/litestream.yml /etc/litestream.yml # The kill grace time is set to zero because our app handles shutdown through SIGTERM. ENV S6_KILL_GRACETIME=0 # Sync disks is enabled so that data is properly flushed. ENV S6_SYNC_DISKS=1 # Reset USER to 472 to reset the escalated privileges USER 472 # # Run the s6 init process on entry. ENTRYPOINT [ "/init" ]
-
Letme Dockerize for you | share your projects
Learn S6-Overlay that allows to have one docker container for multiple processes... make immich docker compose not a two page 8 containers long? But just one clean container with healthcheck. Convince the devs to switch to it.
-
Code-server : Awesome VS Code container on browser (Useful for Fast Cloud Deploy - Fix Corporate Issues)
Custom base docker image with S6 overlay (for more details : just-containers/s6-overlay)
-
Alpine Linux is reducing dependencies on Busybox
Used s6-overlay[1] to start a lot daemons in a docker-image for demo purposes - postgres, tomcat, mysql, php-fpm, apache (don't ask why ;) - s6 worked really well and was reliable and stable - I enjoyed it very much. It was also possible to reliable pass SIGTERM to the daemons in the image for clean shutdown and it was easily possible to configure logging to stdout with a prefix. Modelling dependencies (waiting on database before starting app etc.pp) is possible via shell-scripts. It's super flexible but out of the box it's more like a collection of powerful tools not a complete package - but that's good. It's in the tradition of djb daemontools and is very unix - as in doesn't talk a lot and you better know how each part works but - and that's really cool - it's modular and simple and once you get a grip on it you can easily reason about it. systemd takes a completely different approach and also solves a kind of differnt problem - this is like small pieces of lego that compose well instead of one big chunk of glib/dbus/glibc only c-code.
-
Docker and dedicated user
If you *really* want to make your own containers with PUID/PGID support checkout "S6-overlay" and the linuxserver "baseimage". Somewhere in the startup they end up running:
-
Docker Build Process: Archive Extract onto / (root), overwrites destination directories and contents
FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive ENV TZ="America/New_York" ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/ RUN tar -xvf /tmp/s6-overlay-amd64.tar.gz -C / RUN apt-get update && apt-get install -y wget RUN apt-get autoclean && rm -rf /tmp/* ENTRYPOINT ["/init"]
FROM ubuntu:20.04 ARG S6_OVERLAY_VERSION=3.1.0.1 ARG DEBIAN_FRONTEND=noninteractive ENV TZ="America/New_York" RUN apt-get update && apt-get install -y xz-utils ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz RUN apt-get autoclean && rm -rf /tmp/* ENTRYPOINT ["/init"]
-
Starting a service in Dockerfile
Not sure about unbound or what have inside the pihole base image, you may try to run the service in foreground or use some tiny init service for that container (I just learnt that s6 may work for that, but you must be aware how it should be used)
- Can one use Vault to inject environment variables needed to setup on stack up rather than saving them in environment files with docker-compose?
-
Is it viable to use containers as a turnaround virtual machine?
Any idea where to get started? I've tried using a few repos on github as a point of reference to build my own kali + vnc image, but they're all severely outdated. I spent most of yesterday reverse engineering a dockefile that uses s6 but it was running version 1.2 something and the current version is like 3.0.02 iirc.
What are some alternatives?
docker-restic-cron - Automated Restic backups from Docker
docker-php-nginx - Docker image with PHP-FPM 8.3 & Nginx 1.24 on Alpine Linux
laravel-docker-production
docker
k3s - Lightweight Kubernetes
tinypilot - Use your Raspberry Pi as a browser-based KVM.
flyctl - Command line tools for fly.io services
docker-baseimage-ubuntu
litestream-s6-example - Example repository for building a multi-process Docker container.
docker-php - 🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
nomad-driver-nspawn - A Nomad task driver for systemd-nspawn
whalebrew - Homebrew, but with Docker images