Skip to content

Instantly share code, notes, and snippets.

@H0neyBadger
Last active July 31, 2022 15:14
Show Gist options
  • Save H0neyBadger/e6749fe54927d609e3d3016755960dd5 to your computer and use it in GitHub Desktop.
Save H0neyBadger/e6749fe54927d609e3d3016755960dd5 to your computer and use it in GitHub Desktop.
Toolbox images

Toolbox containers

Build

podman build -f archlinux -t "archlinux:toolbox"

toolbox

toolbox create --container archlinux --image "archlinux:toolbox"

run

toolbox enter --container archlinux
FROM docker.io/library/archlinux:latest
# https://src.fedoraproject.org/container/fedora-toolbox
ENV NAME=arch-toolbox VERSION=latest
LABEL com.github.containers.toolbox="true" \
com.github.debarshiray.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="This image is meant to be used with the toolbox command" \
summary="Base image for creating Fedora toolbox containers" \
maintainer="Debarshi Ray <rishi@fedoraproject.org>"
# Fix
# toolbox: invalid entry point PID of container
RUN touch /etc/machine-id
# toolbox: failed to make /media a symbolic link
RUN mkdir /media
# allow sudo in toolbox
RUN pacman --noconfirm -Sy sudo && pacman --noconfirm -Sc
RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
CMD /bin/sh
[dkp-libs]
Server = https://pkg.devkitpro.org/packages
[dkp-linux]
Server = https://pkg.devkitpro.org/packages/linux/$arch/
FROM docker.io/library/archlinux:latest
# https://src.fedoraproject.org/container/fedora-toolbox
ENV NAME=arch-toolbox VERSION=latest
LABEL com.github.containers.toolbox="true" \
com.github.debarshiray.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="This image is meant to be used with the toolbox command"
# Fix
# toolbox: invalid entry point PID of container
RUN touch /etc/machine-id
# toolbox: failed to make /media a symbolic link
RUN mkdir /media
# allow sudo in toolbox
RUN pacman --noconfirm -Sy sudo && pacman --noconfirm -Sc
RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
###############################
ENV DEVKITPRO=/opt/devkitpro
ENV DEVKITARM=/opt/devkitpro/devkitARM
ENV DEVKITPPC=/opt/devkitpro/devkitPPC
ENV PATH="${PATH}:${DEVKITARM}/bin/:${DEVKITPPC}/bin/"
ENV WORKDIR="/build"
WORKDIR "${WORKDIR}"
RUN pacman-key --init
# Install devkitpro
# doc source :
# https://devkitpro.org/wiki/devkitPro_pacman
# First import the key which is used to validate the packages
RUN pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com && \
pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0
RUN pacman --noconfirm -U https://downloads.devkitpro.org/devkitpro-keyring.pkg.tar.xz
ADD devkit_repo ./devkit_repo
RUN cat ./devkit_repo >> /etc/pacman.conf
# Now resync the database and update installed packages.
# And install requirements
RUN pacman --noconfirm -Syu && \
pacman --noconfirm -S \
git \
pkg-config \
make \
cmake \
vim \
extra/mesa \
extra/libpulse \
extra/alsa-lib \
extra/libxi \
extra/libxrandr \
extra/libxinerama \
extra/libxcursor \
protobuf \
python-protobuf \
devkitARM \
switch-pkg-config \
devkitpro-pkgbuild-helpers \
switch-dev \
switch-zlib \
switch-sdl2 \
switch-freetype \
switch-curl \
switch-glfw \
switch-mesa \
switch-glad \
switch-glm \
switch-libconfig \
switch-sdl2_gfx \
switch-sdl2_ttf \
switch-sdl2_image \
switch-sdl2_mixer \
switch-libexpat \
switch-bzip2 \
switch-libopus \
switch-ffmpeg \
switch-mbedtls && \
yes | pacman -Scc
# the `pacman --noconfirm -Scc` command
# does not assume yes on /var/cache/pacman/pkg/
CMD /bin/sh
FROM docker.io/library/ubuntu:latest
# https://src.fedoraproject.org/container/fedora-toolbox
ENV NAME=ubuntu-toolbox VERSION=latest
LABEL com.github.containers.toolbox="true" \
com.github.debarshiray.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="This image is meant to be used with the toolbox command" \
summary="Base image for creating Fedora toolbox containers" \
maintainer="Debarshi Ray <rishi@fedoraproject.org>"
# allow sudo in toolbox
RUN apt-get update && apt-get install sudo libcap2-bin -y && rm -rf /var/cache/apt
RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
CMD /bin/bash
@H0neyBadger
Copy link
Author

RUN pacman-key --recv-keys --keyserver hkps.pool.sks-keyservers.net BC26F752D25B92CE272E0F44F7FD5492264BB9D0                                                             
RUN pacman-key --lsign --keyserver hkps.pool.sks-keyservers.net BC26F752D25B92CE272E0F44F7FD5492264BB9D0
gpg --keyserver hkps.pool.sks-keyservers.net --search BC26F752D25B92CE272E0F44F7FD5492264BB9D0

@H0neyBadger
Copy link
Author

sudo dnf install -y \
        fish \
        vim \
        vim-syntastic-cpp.noarch \
        vim-syntastic-yaml.noarch \
        vim-syntastic-puppet.noarch \
        vim-syntastic-python.noarch \
        vim-trailing-whitespace.noarch

# https://github.com/devkitPro/buildscripts
sudo dnf install -y \
        make \
        patch \
        cmake \
        gcc \
        autoconf \
        automake \
        bison \
        flex \
        ncurses-devel \
        readline-devel \
        texinfo \
        pkg-config \
        gmp-devel \
        mpfr-devel \
        libmpc-devel \
        zlib-devel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment