Browse Source

init

master
Robin Thoni 7 years ago
commit
28313dbc0b
6 changed files with 70 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 14
    0
      debian-live-builder/Dockerfile
  3. 16
    0
      debian-live-builder/run.sh
  4. 23
    0
      debian-live-builder/run_chroot.sh
  5. 11
    0
      docker-compose.yml
  6. 5
    0
      env

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+data

+ 14
- 0
debian-live-builder/Dockerfile View File

@@ -0,0 +1,14 @@
1
+FROM robinthoni/debian-multiarch:jessie
2
+
3
+MAINTAINER Robin Thoni <robin@rthoni.com>
4
+
5
+RUN mkdir -p /data/output
6
+
7
+RUN apt-get update &&\
8
+    apt-get install -y debootstrap squashfs-tools &&\
9
+    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
10
+
11
+COPY ./run.sh /
12
+COPY ./run_chroot.sh /
13
+
14
+CMD ["/run.sh"]

+ 16
- 0
debian-live-builder/run.sh View File

@@ -0,0 +1,16 @@
1
+#! /usr/bin/env sh
2
+
3
+echo "Building ${DEB_CODENAME} ${DEB_ARCH}"
4
+
5
+cd /data/output &&
6
+
7
+debootstrap --arch="${DEB_ARCH}" --variant=minbase "${DEB_CODENAME}" ./chroot http://ftp.us.debian.org/debian/ &&
8
+cp /run_chroot.sh ./chroot &&
9
+chmod +x ./chroot/run_chroot.sh &&
10
+
11
+chroot ./chroot /run_chroot.sh &&
12
+
13
+rm -f filesystem.squashfs initrd.img vmlinuz &&
14
+mksquashfs ./chroot filesystem.squashfs -e boot &&
15
+cp ./chroot/boot/vmlinuz* vmlinuz &&
16
+cp ./chroot/boot/initrd* initrd.img

+ 23
- 0
debian-live-builder/run_chroot.sh View File

@@ -0,0 +1,23 @@
1
+#! /usr/bin/env sh
2
+
3
+echo "${DEB_HOSTNAME}" > /etc/hostname &&
4
+
5
+apt-get update && \
6
+apt-get install \
7
+    --no-install-recommends \
8
+    --yes \
9
+    --force-yes \
10
+    linux-image-amd64 \
11
+    live-boot \
12
+    systemd-sysv \
13
+    openssh-server &&
14
+
15
+sed -ie 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config &&
16
+
17
+apt-get install \
18
+    --no-install-recommends \
19
+    --yes \
20
+    --force-yes \
21
+    ${DEB_APT_PACKAGES} &&
22
+
23
+echo "${DEB_PASSWD}\n${DEB_PASSWD}" | passwd

+ 11
- 0
docker-compose.yml View File

@@ -0,0 +1,11 @@
1
+version: '2'
2
+
3
+services:
4
+    debian-builder:
5
+        build: ./debian-live-builder
6
+        container_name: debian-live-builder
7
+        privileged: True
8
+        volumes:
9
+            - ./data/debian-live-builder/output:/data/output
10
+        env_file:
11
+            - env

+ 5
- 0
env View File

@@ -0,0 +1,5 @@
1
+DEB_ARCH=amd64
2
+DEB_CODENAME=stretch
3
+DEB_APT_PACKAGES=bash-completion vim xauth
4
+DEB_HOSTNAME=debian-live
5
+DEB_PASSWD=toor42

Loading…
Cancel
Save