Simplify docker debian image build

This commit is contained in:
Fabian 2020-12-31 19:14:31 -06:00
parent f0a85b4d5b
commit 3b9bb1049e
24 changed files with 12 additions and 426 deletions

View file

@ -1,31 +0,0 @@
FROM i386/debian
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get --yes --no-install-recommends install \
linux-image-4.9.0-6-686 grub2 systemd \
gcc make libc6-dev \
wget \
file vim \
&& \
chsh -s /bin/bash && \
echo "root:root" | chpasswd && \
mkdir -p /etc/systemd/system/serial-getty@ttyS0.service.d/ && \
systemctl enable serial-getty@ttyS0.service && \
rm /lib/systemd/system/getty.target.wants/getty-static.service && \
rm /etc/motd /etc/issue && \
systemctl disable systemd-timesyncd.service && \
systemctl disable apt-daily.timer && \
systemctl disable apt-daily-upgrade.timer && \
apt-get --yes clean && \
cd /root/ && \
wget http://www.math.utah.edu/~mayer/linux/nbench-byte-2.2.3.tar.gz && \
tar xfv nbench-byte-2.2.3.tar.gz && \
rm nbench-byte-2.2.3.tar.gz && \
mv nbench-byte-2.2.3 bench && \
cd bench && \
make
COPY getty-noclear.conf getty-override.conf /etc/systemd/system/getty@tty1.service.d/
COPY getty-autologin-serial.conf /etc/systemd/system/serial-getty@ttyS0.service.d/

View file

@ -1,6 +0,0 @@
#!/usr/bin/env bash
set -e
docker build . --rm --tag i386/debian-bench
docker rm debian-bench || true
docker create -t -i --name debian-bench i386/debian-bench bash

View file

@ -1,73 +0,0 @@
#!/usr/bin/env bash
set -ve
if [ $(id -u) != "0" ]
then
echo "Please run as root"
exit 1
fi
OUTFILE=$(dirname "$0")/../../images/debian-bench.img
CONTAINER_NAME=debian-bench
dd if=/dev/zero of=$OUTFILE bs=1k count=600k
(
echo o # Create a new empty DOS partition table
echo n # Add a new partition
echo p # Primary partition
echo 1 # Partition number
echo 2048 # First sector
echo # Last sector (Accept default: varies)
echo a # make bootable
echo w # Write changes
echo q # quit
) | fdisk $OUTFILE
# 1048576 is 2048 (first sector) * 512 (sector size)
mkfs.ext4 -F -E offset=1048576 $OUTFILE
kpartx -a -v $OUTFILE
function finish_kpartx {
kpartx -d $OUTFILE
}
trap finish_kpartx EXIT
# XXX: Assumes loop0
mount /dev/mapper/loop0p1 /mnt
function finish_mount {
umount /mnt
finish_kpartx
}
trap finish_mount EXIT
docker export $CONTAINER_NAME | tar -xvC /mnt/
grub-install --recheck --target=i386-pc --locales= --themes= --fonts= --root-directory /mnt/ /dev/loop0
cat > /mnt/boot/grub/grub.cfg << 'EOF'
set root='hd0' # XXX: I believe this has no significance, but is required to exist by grub
set timeout_style=menu
set timeout=0
menuentry 'Linux' {
#insmod ext2
#insmod gzio
#insmod fat
set root='hd0,msdos1'
echo 'Loading Linux linux ...'
linux /vmlinuz rw root=/dev/sda1 rootfstype=ext4 init=/bin/systemd
#linux /boot/vmlinuz debug verbose rw root=/dev/sda1 rootfstype=ext4
#linux /boot/vmlinuz-virthardened nosplash debug verbose rw root=/dev/sda1 rootfstype=ext4
echo 'Loading initial ramdisk ...'
initrd /initrd.img
#initrd /boot/initramfs-vanilla
#initrd /boot/initramfs-virthardened
}
EOF
echo $OUTFILE created.

View file

@ -1,4 +0,0 @@
[app] (name=fbrun)
[Position] (WINCENTER) {0 0}
[Layer] {2}
[end]

View file

@ -1,82 +0,0 @@
! If you're looking for settings to configure, they won't be saved here until
! you change something in the fluxbox configuration menu.
session.menuFile: ~/.fluxbox/menu
session.keyFile: ~/.fluxbox/keys
#session.styleFile: ~/.fluxbox/styles/Clearlooks
session.screen0.rootCommand: fbsetroot -solid black
session.screen0.slit.layer: Dock
session.screen0.slit.onhead: 0
session.screen0.slit.acceptKdeDockapps: true
session.screen0.slit.autoHide: false
session.screen0.slit.placement: RightBottom
session.screen0.slit.alpha: 255
session.screen0.slit.maxOver: false
session.screen0.window.focus.alpha: 255
session.screen0.window.unfocus.alpha: 255
session.screen0.tabs.usePixmap: true
session.screen0.tabs.maxOver: false
session.screen0.tabs.intitlebar: true
session.screen0.titlebar.left: Stick
session.screen0.titlebar.right: Minimize Maximize Close
session.screen0.iconbar.usePixmap: true
session.screen0.iconbar.mode: {static groups} (workspace)
session.screen0.iconbar.alignment: Relative
session.screen0.iconbar.iconWidth: 128
session.screen0.iconbar.iconTextPadding: 10
session.screen0.clientMenu.usePixmap: true
session.screen0.menu.alpha: 255
session.screen0.toolbar.placement: BottomCenter
session.screen0.toolbar.layer: Dock
session.screen0.toolbar.autoHide: false
session.screen0.toolbar.visible: false
session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, iconbar, systemtray, clock
session.screen0.toolbar.onhead: 1
session.screen0.toolbar.widthPercent: 100
session.screen0.toolbar.maxOver: false
session.screen0.toolbar.height: 0
session.screen0.toolbar.alpha: 255
session.screen0.tab.placement: TopLeft
session.screen0.tab.width: 64
session.screen0.tabFocusModel: ClickToTabFocus
session.screen0.autoRaise: true
session.screen0.maxDisableMove: false
session.screen0.edgeSnapThreshold: 10
session.screen0.tooltipDelay: 500
session.screen0.colPlacementDirection: TopToBottom
session.screen0.opaqueMove: true
session.screen0.windowPlacement: RowMinOverlapPlacement
session.screen0.focusNewWindows: true
session.screen0.clickRaises: true
session.screen0.maxDisableResize: false
session.screen0.allowRemoteActions: false
session.screen0.windowMenu: /root/.fluxbox/windowmenu
session.screen0.fullMaximization: false
session.screen0.defaultDeco: NORMAL
session.screen0.noFocusWhileTypingDelay: 0
session.screen0.menuDelay: 200
session.screen0.workspacewarping: true
session.screen0.focusSameHead: false
session.screen0.workspaceNames: Workspace 1,Workspace 2,Workspace 3,Workspace 4,
session.screen0.workspaces: 4
session.screen0.maxIgnoreIncrement: true
session.screen0.showwindowposition: false
session.screen0.focusModel: ClickFocus
session.screen0.rowPlacementDirection: LeftToRight
session.screen0.strftimeFormat: %k:%M
session.doubleClickInterval: 250
session.slitlistFile: /root/.fluxbox/slitlist
session.cacheLife: 5
session.tabPadding: 0
session.cacheMax: 200
session.appsFile: /root/.fluxbox/apps
session.ignoreBorder: false
session.styleOverlay: /root/.fluxbox/overlay
session.forcePseudoTransparency: false
session.tabsAttachArea: Window
session.autoRaiseDelay: 250
session.configVersion: 13
session.colorsPerChannel: 4
session.menuSearch: itemstart

View file

@ -1,137 +0,0 @@
# click on the desktop to get menus
OnDesktop Mouse1 :HideMenus
OnDesktop Mouse2 :WorkspaceMenu
OnDesktop Mouse3 :RootMenu
# scroll on the desktop to change workspaces
OnDesktop Mouse4 :PrevWorkspace
OnDesktop Mouse5 :NextWorkspace
# scroll on the toolbar to change current window
OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no)
OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no)
# alt + left/right click to move/resize a window
OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
OnWindowBorder Move1 :StartMoving
OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}
OnLeftGrip Move1 :StartResizing bottomleft
OnRightGrip Move1 :StartResizing bottomright
# alt + middle click to lower the window
OnWindow Mod1 Mouse2 :Lower
# control-click a window's titlebar and drag to attach windows
OnTitlebar Control Mouse1 :StartTabbing
# double click on the titlebar to shade
OnTitlebar Double Mouse1 :Shade
# left click on the titlebar to move the window
OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab}
OnTitlebar Move1 :StartMoving
# middle click on the titlebar to lower
OnTitlebar Mouse2 :Lower
# right click on the titlebar for a menu of options
OnTitlebar Mouse3 :WindowMenu
# alt-tab
Mod1 Tab :NextWindow {groups} (workspace=[current])
Mod1 Shift Tab :PrevWindow {groups} (workspace=[current])
# cycle through tabs in the current window
Mod4 Tab :NextTab
Mod4 Shift Tab :PrevTab
# go to a specific tab in the current window
Mod4 1 :Tab 1
Mod4 2 :Tab 2
Mod4 3 :Tab 3
Mod4 4 :Tab 4
Mod4 5 :Tab 5
Mod4 6 :Tab 6
Mod4 7 :Tab 7
Mod4 8 :Tab 8
Mod4 9 :Tab 9
# open a terminal
Mod1 F1 :Exec xterm
# open a dialog to run programs
Mod1 F2 :Exec fbrun
# volume settings, using common keycodes
# if these don't work, use xev to find out your real keycodes
176 :Exec amixer sset Master,0 1+
174 :Exec amixer sset Master,0 1-
160 :Exec amixer sset Master,0 toggle
# current window commands
Mod1 F4 :Close
Mod1 F5 :Kill
Mod1 F9 :Minimize
Mod1 F10 :Maximize
Mod1 F11 :Fullscreen
# open the window menu
Mod1 space :WindowMenu
# exit fluxbox
Control Mod1 Delete :Exit
# change to previous/next workspace
Control Mod1 Left :PrevWorkspace
Control Mod1 Right :NextWorkspace
# send the current window to previous/next workspace
Mod4 Left :SendToPrevWorkspace
Mod4 Right :SendToNextWorkspace
# send the current window and follow it to previous/next workspace
Control Mod4 Left :TakeToPrevWorkspace
Control Mod4 Right :TakeToNextWorkspace
# change to a specific workspace
Control F1 :Workspace 1
Control F2 :Workspace 2
Control F3 :Workspace 3
Control F4 :Workspace 4
Control F5 :Workspace 5
Control F6 :Workspace 6
Control F7 :Workspace 7
Control F8 :Workspace 8
Control F9 :Workspace 9
Control F10 :Workspace 10
Control F11 :Workspace 11
Control F12 :Workspace 12
# send the current window to a specific workspace
Mod4 F1 :SendToWorkspace 1
Mod4 F2 :SendToWorkspace 2
Mod4 F3 :SendToWorkspace 3
Mod4 F4 :SendToWorkspace 4
Mod4 F5 :SendToWorkspace 5
Mod4 F6 :SendToWorkspace 6
Mod4 F7 :SendToWorkspace 7
Mod4 F8 :SendToWorkspace 8
Mod4 F9 :SendToWorkspace 9
Mod4 F10 :SendToWorkspace 10
Mod4 F11 :SendToWorkspace 11
Mod4 F12 :SendToWorkspace 12
# send the current window and change to a specific workspace
Control Mod4 F1 :TakeToWorkspace 1
Control Mod4 F2 :TakeToWorkspace 2
Control Mod4 F3 :TakeToWorkspace 3
Control Mod4 F4 :TakeToWorkspace 4
Control Mod4 F5 :TakeToWorkspace 5
Control Mod4 F6 :TakeToWorkspace 6
Control Mod4 F7 :TakeToWorkspace 7
Control Mod4 F8 :TakeToWorkspace 8
Control Mod4 F9 :TakeToWorkspace 9
Control Mod4 F10 :TakeToWorkspace 10
Control Mod4 F11 :TakeToWorkspace 11
Control Mod4 F12 :TakeToWorkspace 12

View file

@ -1,61 +0,0 @@
# Generated by fluxbox-generate_menu
#
# If you read this it means you want to edit this file manually, so here
# are some useful tips:
#
# - You can add your own menu-entries to ~/.fluxbox/usermenu
#
# - If you miss apps please let me know and I will add them for the next
# release.
#
# - The -r option prevents removing of empty menu entries and lines which
# makes things much more readable.
#
# - To prevent any other app from overwriting your menu
# you can change the menu name in ~/.fluxbox/init to:
# session.menuFile: ~/.fluxbox/my-menu
[begin] (Fluxbox)
[encoding] {UTF-8}
[exec] (xterm) {xterm}
[exec] (firefox) {} execname is NULL; cannot lookup
[exec] (Run) {fbrun}
[submenu] (Terminals)
[exec] (xterm) {xterm}
[end]
[submenu] (Editors)
[exec] (vim) {xterm -e vim}
[exec] (vi) {xterm -e vi}
[end]
[submenu] (Multimedia)
[submenu] (X-utils)
[exec] (Reload .Xdefaults) {xrdb -load $HOME/.Xdefaults}
[end]
[end]
[submenu] (Office)
[exec] (Open Office) {soffice}
[end]
[submenu] (System Tools)
[exec] (top) {xterm -e top}
[end]
[submenu] (Fluxbox menu)
[config] (Configure)
[submenu] (System Styles) {Choose a style...}
[stylesdir] (/usr/share/fluxbox/styles)
[end]
[submenu] (User Styles) {Choose a style...}
[stylesdir] (~/.fluxbox/styles)
[end]
[workspaces] (Workspace List)
[submenu] (Tools)
[exec] (Run) {fbrun}
[exec] (Regen Menu) {fluxbox-generate_menu}
[end]
[commanddialog] (Fluxbox Command)
[reconfig] (Reload config)
[restart] (Restart)
[exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) | xmessage -file - -center}
[separator]
[exit] (Exit)
[end]
[endencoding]
[end]

View file

@ -1,2 +0,0 @@
! The following line will prevent styles from setting the background.
background: none

View file

@ -1,15 +0,0 @@
[begin]
[shade]
[stick]
[maximize]
[iconify]
[raise]
[lower]
[settitledialog]
[sendto]
[layer]
[alpha]
[extramenus]
[separator]
[close]
[end]

View file

@ -1,3 +0,0 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noissue --noclear -s %I 115200,38400,9600 vt102

View file

@ -1,2 +0,0 @@
[Service]
TTYVTDisallocate=no

View file

@ -1,3 +0,0 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noissue --noclear %I 38400 $TERM

View file

@ -2,10 +2,11 @@ FROM i386/debian
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get --yes --no-install-recommends install \
linux-image-4.9.0-6-686 grub2 systemd \
RUN apt update && \
apt --yes --no-install-recommends install \
linux-image-686 grub2 systemd \
libterm-readline-perl-perl \
gcc make libc6-dev \
unzip bzip2 xz-utils \
fluxbox \
xserver-xorg-input-kbd xserver-xorg-input-mouse xserver-xorg-input-evdev \
@ -15,7 +16,6 @@ RUN apt-get update && \
libc-l10n locales \
fonts-noto fonts-droid-fallback \
strace file xterm vim apt-file \
winbind cabextract \
dhcpcd5 \
wget curl \
net-tools netcat \
@ -31,12 +31,18 @@ RUN apt-get update && \
systemctl enable serial-getty@ttyS0.service && \
rm /lib/systemd/system/getty.target.wants/getty-static.service && \
rm /etc/motd /etc/issue && \
systemctl disable winbind.service && \
systemctl disable systemd-timesyncd.service && \
systemctl disable apt-daily.timer && \
systemctl disable apt-daily-upgrade.timer && \
systemctl disable dhcpcd.service && \
echo "tmpfs /tmp tmpfs nodev,nosuid 0 0" >> /etc/fstab
echo "tmpfs /tmp tmpfs nodev,nosuid 0 0" >> /etc/fstab && \
cd /root/ && \
wget http://www.math.utah.edu/~mayer/linux/nbench-byte-2.2.3.tar.gz && \
tar xfv nbench-byte-2.2.3.tar.gz && \
rm nbench-byte-2.2.3.tar.gz && \
mv nbench-byte-2.2.3 bench && \
cd bench && \
make
COPY getty-noclear.conf getty-override.conf /etc/systemd/system/getty@tty1.service.d/
COPY getty-autologin-serial.conf /etc/systemd/system/serial-getty@ttyS0.service.d/
@ -45,7 +51,6 @@ COPY logind.conf /etc/systemd/logind.conf
#COPY xinitrc /root/.xinitrc
COPY xorg.conf /etc/X11/
COPY fluxbox /root/.fluxbox
COPY networking.sh /root/
COPY boot-9p /etc/initramfs-tools/scripts/boot-9p