-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
executable file
·87 lines (72 loc) · 1.98 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM madworx/qemu:latest
MAINTAINER Martin Kjellstrand [https://github.com/madworx]
ENV SYSTEM_MEMORY=2G \
SYSTEM_CPUS=4 \
SSH_PUBKEY="" \
SSH_PORT=22 \
USER_ID="" \
USER_NAME=""
ARG AIX_MIRROR=ftp://ftp.software.ibm.com/software/server/diags
ARG AIX_PY=https://worthdoingbadly.com/assets/blog/aixqemu/patch_cd72220.py
ARG AIX_VERSION=7.2
ARG AIX_ARCH=amd64
ARG AIX_SETS="CD72220.iso"
ARG AIX_PKGSRC_PACKAGES="bash"
ENV AIX_ARCH=$AIX_ARCH \
AIX_VERSION=$AIX_VERSION \
PYTHON_VERSION=2.7.17
EXPOSE ${SSH_PORT}
EXPOSE 4444
RUN apk add --no-cache curl unfs3 python git make gcc
#
# Download sets:
#
RUN cd /tmp \
&& echo -n "Downloading sets from [${AIX_MIRROR}]:" \
&& for set in ${AIX_SETS} ; do \
echo -n " ${set}" ; \
urls="${urls} -O ${AIX_MIRROR}/${set}" ; \
done \
&& echo "." \
&& curl --fail-early --retry-connrefused --retry 20 ${urls}
#
# Download patch_cd72220.py file:
#
RUN cd /tmp \
&& curl --retry-connrefused --retry 20 -O "${AIX_PY}" \
&& python patch_cd72220.py CD72220.iso ModdedCD.iso
#
# Verify checksum, unpack (and remove) sets:
#
RUN mkdir /aix \
&& cd /aix \
&& for set in ${AIX_SETS} ; do \
cp /tmp/ModdedCD.iso . || exit 1 ; \
rm /tmp/${set} ; \
rm /tmp/ModdedCD.iso ; \
done
RUN ssh-keygen -f /root/.ssh/id_rsa -N ''
#
# Copy required files:
#
COPY scripts/ /scripts/
COPY docker-entrypoint.sh /
COPY install-qemu.sh /
COPY pxeboot_ia32_com0.bin /aix/
COPY add-ssh-key.sh /usr/bin/add-ssh-key
COPY aix.sh /usr/bin/aix
#
# Run the pre-first-boot setup script:
#
RUN /scripts/system-setup.pre.aix \
&& sh /install-qemu.sh;
#
# Run the post-first-boot setup script:
#
RUN /scripts/system-setup.post.aix
ENTRYPOINT [ "/docker-entrypoint.sh" ]
HEALTHCHECK --timeout=10s --interval=15s \
--retries=20 --start-period=30s \
CMD ssh root@localhost -p 22 \
-oConnectTimeout=5 \
/bin/echo ok > /dev/null 2>&1