-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
58 lines (54 loc) · 1.82 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
FROM golang:1.17-alpine AS build-kubedoom
WORKDIR /go/src/kubedoom
ADD go.mod .
ADD kubedoom.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubedoom .
FROM ubuntu:22.04 AS build-essentials
ARG TARGETARCH
ARG KUBECTL_VERSION=1.25.3
RUN apt-get update && apt-get install -y \
-o APT::Install-Suggests=0 \
--no-install-recommends \
wget ca-certificates
RUN wget http://distro.ibiblio.org/pub/linux/distributions/slitaz/sources/packages/d/doom1.wad
RUN echo "TARGETARCH is $TARGETARCH"
RUN echo "KUBECTL_VERSION is $KUBECTL_VERSION"
RUN wget -O /usr/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl" \
&& chmod +x /usr/bin/kubectl
FROM ubuntu:22.04 AS build-doom
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
-o APT::Install-Suggests=0 \
--no-install-recommends \
build-essential \
libsdl-mixer1.2-dev \
libsdl-net1.2-dev \
gcc
ADD /dockerdoom /dockerdoom
WORKDIR /dockerdoom/trunk
RUN ./configure && make && make install
FROM ubuntu:22.04 as build-converge
WORKDIR /build
RUN mkdir -p \
/build/root \
/build/usr/bin \
/build/usr/local/games
COPY --from=build-essentials /doom1.wad /build/root
COPY --from=build-essentials /usr/bin/kubectl /build/usr/bin
COPY --from=build-kubedoom /go/src/kubedoom/kubedoom /build/usr/bin
COPY --from=build-doom /usr/local/games/psdoom /build/usr/local/games
FROM ubuntu:22.04
ARG VNCPASSWORD=idbehold
RUN apt-get update && apt-get install -y \
-o APT::Install-Suggests=0 \
--no-install-recommends \
libsdl-mixer1.2 \
libsdl-net1.2 \
x11vnc \
xvfb \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /root/.vnc && x11vnc -storepasswd "${VNCPASSWORD}" /root/.vnc/passwd
COPY --from=build-converge /build /
WORKDIR /root
ENTRYPOINT ["/usr/bin/kubedoom"]