diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2026-08-29 15:44:43 +0200 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2026-08-29 18:51:31 +0200 |
| commit | 99561277e31caeffa7fc9d722650247511ad3bf7 (patch) | |
| tree | e198e15d47d873624ba4f00e234ed3b3fa0d466d /container | |
| parent | be775d4675b19b7f033c01f6826da11b16d7288b (diff) | |
Refactoring to a C Binary
Diffstat (limited to 'container')
| -rw-r--r-- | container/Containerfile | 28 | ||||
| -rwxr-xr-x | container/init | 10 |
2 files changed, 38 insertions, 0 deletions
diff --git a/container/Containerfile b/container/Containerfile new file mode 100644 index 0000000..2498b12 --- /dev/null +++ b/container/Containerfile @@ -0,0 +1,28 @@ +FROM docker.io/library/debian:13 + +# Flag that we are a devbox +RUN touch /run/.dbxenv + +# Remove container-specific APT configurations, and install required packages +RUN rm /etc/apt/apt.conf.d/docker-* && \ + apt-get update && \ + apt-get install -y \ + locales \ + openssh-server \ + sudo \ + tini \ + && \ + apt-get clean && \ + rm -dr /var/lib/apt/lists/* + +# Configure locale with UTF-8 support +RUN update-locale LANG=C.UTF-8 LC_ALL=C.UTF-8 + +# Configure SSH server +RUN echo "StreamLocalBindUnlink yes" >> /etc/ssh/sshd_config && \ + echo "AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config && \ + touch /etc/ssh/authorized_keys + +# Set up the entrypoint +COPY init /sbin/init +ENTRYPOINT ["/sbin/init"] diff --git a/container/init b/container/init new file mode 100755 index 0000000..24b6629 --- /dev/null +++ b/container/init @@ -0,0 +1,10 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-3.0-only +# SPDX-FileCopyrightText: 2026 Nicholas Rodrigues Lordello <[email protected]> + +if [ ! -f /run/.dbxenv ]; then + echo "ERROR: not in a devbox" >&2 + exit 1 +fi + +exec /usr/bin/tini /usr/sbin/sshd -- -D -e |
