forked from binhex/arch-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (33 loc) · 1.52 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM scratch
LABEL org.opencontainers.image.authors = "binhex"
LABEL org.opencontainers.image.source = "https://github.com/binhex/arch-base"
# additional files
##################
# add supervisor conf file
ADD build/*.conf /etc/supervisor.conf
# add install bash script
ADD build/root/*.sh /root/
# add statically linked busybox
ADD build/utils/busybox/busybox /bootstrap/busybox
# unpack tarball
################
# symlink busybox utilities to /bootstrap folder
RUN ["/bootstrap/busybox", "--install", "-s", "/bootstrap"]
# run busybox bourne shell and use sub shell to execute busybox utils (wget, rm...)
# to download and extract tarball.
# once the tarball is extracted we then use bash to execute the install script to
# install everything else for the base image.
# note, do not line wrap the below command, as it will fail looking for /bin/sh
RUN ["/bootstrap/sh", "-c", "/bootstrap/wget --timeout=60 -O /bootstrap/archlinux.tar.gz http://mirror.bytemark.co.uk/archlinux/iso/latest/archlinux-bootstrap-x86_64.tar.gz && /bootstrap/tar --exclude=root.x86_64/etc/resolv.conf --exclude=root.x86_64/etc/hosts -xvf /bootstrap/archlinux.tar.gz --strip-components=1 -C / && /bin/bash -c 'chmod +x /root/*.sh && /bin/bash /root/install.sh'"]
# env
#####
# set environment variables for user nobody
ENV HOME /home/nobody
# set environment variable for terminal
ENV TERM xterm
# set environment variables for language
ENV LANG en_GB.UTF-8
# run
#####
# run dumb-init to manage graceful exit and zombie reaping
ENTRYPOINT ["/usr/bin/dumb-init", "--"]