-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from AdamIsrael/images
Images
- Loading branch information
Showing
10 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# build toolbox images | ||
set -eu | ||
|
||
# Scan the images we have available | ||
|
||
IMAGES=$(find images -type f -name Containerfile | awk -F/ '{printf "%s-%s\n", $2, $3}') | ||
|
||
# mapfile -t test $IMAGES | ||
|
||
# echo $IMAGES | ||
|
||
|
||
find images/ -type f -name Containerfile -print0 | | ||
while IFS= read -r -d '' line; do | ||
image=$(echo $line | awk -F/ '{printf "%s-%s\n", $2, $3}') | ||
|
||
echo "Building $image..." | ||
|
||
|
||
# Think about where to redirect the output. Maybe a temp log? | ||
|
||
podman build -t $image -f $line > /dev/null | ||
|
||
|
||
# echo "$line ($image)" | ||
# Error: container debian-sid already exists | ||
echo "To create a container using this image, run:" | ||
echo "toolbox create --image $image -c my-project" | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Images | ||
|
||
| Distribution | Release | Description | | ||
| -------------| ------- | ----------- | | ||
| Arch | latest | Arch Linux | | ||
| Debian | sid | Debian Sid | | ||
| Ubuntu | 18.04 | Ubuntu 18.04 LTS | | ||
| Ubuntu | 20.04 | Ubuntu 20.04 LTS | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Based on the Dockerfile by Emanuele Palazzetti <emanuele.palazzetti@gmail.com> | ||
# https://github.com/palazzem/archlinux-toolbox | ||
|
||
FROM docker.io/archlinux:latest | ||
|
||
ENV NAME=arch-toolbox VERSION=rolling | ||
LABEL com.github.containers.toolbox="true" \ | ||
com.github.debarshiray.toolbox="true" \ | ||
name="$NAME" \ | ||
version="$VERSION" \ | ||
usage="This image is meant to be used with the toolbox command" \ | ||
summary="Base image for creating Arch toolbox containers" \ | ||
maintainer="Adam Israel <adam@adamisrael.com>" | ||
|
||
# Install required dependencies to run `toolbox` | ||
RUN pacman -Sy sudo git --noconfirm && \ | ||
pacman -Scc --noconfirm | ||
|
||
# COPY extra-packages / | ||
# RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ | ||
# apt-get update && \ | ||
# yes | /usr/local/sbin/unminimize && \ | ||
# DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
# ubuntu-minimal ubuntu-standard \ | ||
# libnss-myhostname \ | ||
# $(cat extra-packages | xargs) && \ | ||
# rm -rd /var/lib/apt/lists/* | ||
# RUN rm /extra-packages | ||
|
||
|
||
# Required steps otherwise `toolbox` fails to start the container: | ||
# 1. machine-id must be present in the base image | ||
# 2. $(whoami) must be in the sudoer list without password | ||
# 3. /media must be present (toolbox tries to remove the folder and create a symlink) | ||
RUN touch /etc/machine-id && \ | ||
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/toolbox && \ | ||
mkdir /media | ||
|
||
CMD /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM docker.io/library/debian:sid | ||
|
||
ENV NAME=debian-toolbox VERSION=sid | ||
LABEL com.github.containers.toolbox="true" \ | ||
com.github.debarshiray.toolbox="true" \ | ||
name="$NAME" \ | ||
version="$VERSION" \ | ||
usage="This image is meant to be used with the toolbox command" \ | ||
summary="Base image for creating Debian sid toolbox containers" \ | ||
maintainer="Adam Israel <adam@adamisrael.com>" | ||
|
||
RUN apt-get update && apt-get -y upgrade && \ | ||
apt-get -y install \ | ||
bash-completion \ | ||
git \ | ||
keyutils \ | ||
libcap2-bin \ | ||
lsof \ | ||
man-db \ | ||
mlocate \ | ||
mtr \ | ||
rsync \ | ||
sudo \ | ||
tcpdump \ | ||
time \ | ||
traceroute \ | ||
tree \ | ||
unzip \ | ||
wget \ | ||
zip && \ | ||
apt-get clean | ||
|
||
RUN sed -i -e 's/ ALL$/ NOPASSWD:ALL/' /etc/sudoers | ||
|
||
RUN echo VARIANT_ID=container >> /etc/os-release | ||
RUN touch /etc/localtime | ||
|
||
CMD /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Originally based on the dockerfile created by Ievgen Popovych <jmennius@gmail.com> | ||
|
||
FROM docker.io/library/ubuntu:18.04 | ||
|
||
LABEL com.github.containers.toolbox="true" \ | ||
com.github.debarshiray.toolbox="true" \ | ||
name="ubuntu-toolbox" \ | ||
version="18.04" \ | ||
usage="This image is meant to be used with the toolbox command" \ | ||
summary="Base image for creating Ubuntu toolbox containers" \ | ||
maintainer="Adam Israel <adam@adamisrael.com>" | ||
|
||
COPY README.md / | ||
|
||
# remove some container-optimized apt configuration; | ||
# removing docker-gzip-indexes specifically helps with command-not-found | ||
RUN rm -f /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages | ||
|
||
# Restore documentation but do not upgrade all packages, that's not appropriate; | ||
# Install ubuntu-minimal & ubuntu-standard | ||
# Install extra packages as well as libnss-myhostname | ||
COPY extra-packages / | ||
RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ | ||
apt-get update && \ | ||
yes | /usr/local/sbin/unminimize && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
ubuntu-minimal ubuntu-standard \ | ||
libnss-myhostname \ | ||
$(cat extra-packages | xargs) && \ | ||
rm -rd /var/lib/apt/lists/* | ||
RUN rm /extra-packages | ||
|
||
# Allow authentication with empty password, promptless | ||
RUN sed -i '/^auth.*pam_unix.so/s/nullok_secure/try_first_pass nullok/' /etc/pam.d/common-auth | ||
|
||
# Fix empty bind-mount to clear selinuxfs (see #337) | ||
RUN mkdir -p /usr/share/empty | ||
|
||
CMD /bin/sh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
git | ||
keyutils | ||
gnupg2 | ||
tree | ||
unzip | ||
zip | ||
zsh | ||
curl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Originally based on the dockerfile created by Ievgen Popovych <jmennius@gmail.com> | ||
|
||
FROM docker.io/library/ubuntu:20.04 | ||
|
||
LABEL com.github.containers.toolbox="true" \ | ||
com.github.debarshiray.toolbox="true" \ | ||
name="ubuntu-toolbox" \ | ||
version="20.04" \ | ||
usage="This image is meant to be used with the toolbox command" \ | ||
summary="Base image for creating Ubuntu toolbox containers" \ | ||
maintainer="Adam Israel <adam@adamisrael.com>" | ||
|
||
COPY README.md / | ||
|
||
# remove some container-optimized apt configuration; | ||
# removing docker-gzip-indexes specifically helps with command-not-found | ||
RUN rm -f /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages | ||
|
||
# Restore documentation but do not upgrade all packages, that's not appropriate; | ||
# Install ubuntu-minimal & ubuntu-standard | ||
# Install extra packages as well as libnss-myhostname | ||
COPY extra-packages / | ||
RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ | ||
apt-get update && \ | ||
yes | /usr/local/sbin/unminimize && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
ubuntu-minimal ubuntu-standard \ | ||
libnss-myhostname \ | ||
$(cat extra-packages | xargs) && \ | ||
rm -rd /var/lib/apt/lists/* | ||
RUN rm /extra-packages | ||
|
||
# Allow authentication with empty password, promptless | ||
RUN sed -i '/^auth.*pam_unix.so/s/nullok_secure/try_first_pass nullok/' /etc/pam.d/common-auth | ||
|
||
# Fix empty bind-mount to clear selinuxfs (see #337) | ||
RUN mkdir -p /usr/share/empty | ||
|
||
CMD /bin/sh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
git | ||
keyutils | ||
gnupg2 | ||
tree | ||
unzip | ||
zip | ||
zsh | ||
curl |