Run Fedora with systemd as a GitHub Codespaces
Note
This image is based on my gbraad-devenv/fedora image, and is therefore personalized;
it uses gbraad
as user with my dotfiles and tailored to use services exposed by my homelab setup.
The Containerfile
has /sbin/init
as entrypoint after setting USER root
.
The following is a short overview of what is necessary to make this work.
/.devcontainer/Containerfile
ARG BASE_VERSION="41"
FROM quay.io/fedora/fedora:${BASE_VERSION}
LABEL org.opencontainers.image.source = "https://github.com/gbraad-devenv/fedora"
USER root
RUN dnf install -y \
systemd sudo git-core \
&& dnf clean all \
&& rm -rf /var/cache/yum
ENTRYPOINT ["/sbin/init"]
/.devcontainer/devcontainer.json
{
"name": "Fedora with systemd on Codespaces",
"build": {
"dockerfile": "Containerfile"
},
"overrideCommand": false,
"privileged": true
}