Sign inSign up

trinitronx/ubuntu-sshd-builder

By trinitronx

Updated 9 months ago

arm64, amd64 multiplatform image for personal interactive CLI development. Entrypoint: sshd -D

Buildkit cache
Image
0

10K+

trinitronx/ubuntu-sshd-builder repository overview

Workaround for qemu-system-aarch64 based interactive tty shell not working on x86_64 hosts: Just use ssh to get an interactive shell inside the container. This container is for building (and signing) debian packages. Therefore, it should only be run in Development or CI environments, and the default username & password are insecure on purpose:

Username: ubuntu Password: ubuntu

To run whichever architecture is native (OCI manifest has: arm64, and amd64 images):

docker run -d --rm  -p 2222:22 trinitronx/ubuntu-sshd-builder:25.10

To run a specific architecture, use --platform or DOCKER_DEFAULT_PLATFORM:

docker run -d --rm  -p 2223:22 --platform arm64 trinitronx/ubuntu-sshd-builder:25.10
# OR...
( export DOCKER_DEFAULT_PLATFORM=linux/arm64 docker run -d --rm -p 2223:22 trinitronx/ubuntu-sshd-builder:25.10  )

Then ssh into the container to access an interactive CLI for build purposes:

ssh -p 2222 -o LogLevel=FATAL -o Compression=yes  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  ubuntu@localhost

To forward an SSH agent & GPG agent for use with package signing:

ssh -p 2222 -A  -o LogLevel=FATAL -o Compression=yes  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent:/run/user/1000/gnupg/S.gpg-agent -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.extra:/run/user/1000/gnupg/S.gpg-agent.extra  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.ssh:/run/user/1000/gnupg/S.gpg-agent.ssh  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.browser:/run/user/1000/gnupg/S.gpg-agent.browser -o RemoteForward=/run/user/1000/gnupg/S.scdaemon:/run/user/1000/gnupg/S.scdaemon  ubuntu@localhost

Note that the default GPG socketdir is /run/user/1000/gnupg:

$ gpgconf --list-dirs | grep socket
socketdir:/run/user/1000/gnupg
dirmngr-socket:/run/user/1000/gnupg/S.dirmngr
keyboxd-socket:/run/user/1000/gnupg/S.keyboxd
agent-ssh-socket:/run/user/1000/gnupg/S.gpg-agent.ssh
agent-extra-socket:/run/user/1000/gnupg/S.gpg-agent.extra
agent-browser-socket:/run/user/1000/gnupg/S.gpg-agent.browser
agent-socket:/run/user/1000/gnupg/S.gpg-agent

The containing directory for ubuntu UID 1000 should exist and be empty in a fresh container. However, when using multiple ssh sessions, some old socket files may persist and need to be cleaned up for gpg inside the container to be able to contact gpg-agent on the host (or ssh client) through the sockets. Clean them up first, then reconnect and it should work again:

rm -f /run/user/1000/gnupg/S.*
exit

Back on SSH client machine, reconnect:

ssh -p 2222 -A  -o LogLevel=FATAL -o Compression=yes  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent:/run/user/1000/gnupg/S.gpg-agent -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.extra:/run/user/1000/gnupg/S.gpg-agent.extra  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.ssh:/run/user/1000/gnupg/S.gpg-agent.ssh  -o RemoteForward=/run/user/1000/gnupg/S.gpg-agent.browser:/run/user/1000/gnupg/S.gpg-agent.browser -o RemoteForward=/run/user/1000/gnupg/S.scdaemon:/run/user/1000/gnupg/S.scdaemon  ubuntu@localhost

Tag summary

Content type

Image

Digest

sha256:c8de54408

Size

245.3 MB

Last updated

9 months ago

docker pull trinitronx/ubuntu-sshd-builder