ARM64 Support, GitHub Actions Workflow
This commit is contained in:
committed by
David Zuber
parent
f834f328c1
commit
09159f4fb5
32
.github/workflows/container.yaml
vendored
Normal file
32
.github/workflows/container.yaml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Container Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['[0-9]+.[0-9]+.[0-9]+']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: docker/setup-qemu-action@v1
|
||||||
|
- uses: docker/setup-buildx-action@v1
|
||||||
|
- uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- id: version
|
||||||
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||||
|
- uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64, linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |-
|
||||||
|
ghcr.io/${{ github.repository }}:latest
|
||||||
|
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
|
63
Dockerfile
63
Dockerfile
@ -1,56 +1,57 @@
|
|||||||
FROM golang:1.14-alpine AS gobuild
|
FROM golang:1.17-alpine AS build-kubedoom
|
||||||
|
|
||||||
WORKDIR /go/src/kubedoom
|
WORKDIR /go/src/kubedoom
|
||||||
|
ADD go.mod .
|
||||||
ADD kubedoom.go .
|
ADD kubedoom.go .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubedoom .
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubedoom .
|
||||||
|
|
||||||
FROM ubuntu:20.10 AS ubuntu
|
FROM ubuntu:21.10 AS build-essentials
|
||||||
# make sure the package repository is up to date
|
ARG TARGETARCH
|
||||||
RUN apt-get update
|
ARG KUBECTL_VERSION=1.23.2
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
FROM ubuntu AS ubuntu-deps
|
|
||||||
# Install dependencies
|
|
||||||
RUN apt-get install -y \
|
|
||||||
-o APT::Install-Suggests=0 \
|
-o APT::Install-Suggests=0 \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
wget ca-certificates
|
wget ca-certificates
|
||||||
RUN wget http://distro.ibiblio.org/pub/linux/distributions/slitaz/sources/packages/d/doom1.wad
|
RUN wget http://distro.ibiblio.org/pub/linux/distributions/slitaz/sources/packages/d/doom1.wad
|
||||||
RUN wget -O /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(wget -O- https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
|
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
|
&& chmod +x /usr/bin/kubectl
|
||||||
|
|
||||||
FROM ubuntu AS ubuntu-build
|
FROM ubuntu:21.10 AS build-doom
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
-o APT::Install-Suggests=0 \
|
-o APT::Install-Suggests=0 \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
libsdl-mixer1.2-dev \
|
libsdl-mixer1.2-dev \
|
||||||
libsdl-net1.2-dev \
|
libsdl-net1.2-dev \
|
||||||
gcc
|
gcc
|
||||||
|
|
||||||
# Setup doom
|
|
||||||
ADD /dockerdoom /dockerdoom
|
ADD /dockerdoom /dockerdoom
|
||||||
RUN cd /dockerdoom/trunk && ./configure && make && make install
|
WORKDIR /dockerdoom/trunk
|
||||||
|
RUN ./configure && make && make install
|
||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu:21.10 as build-converge
|
||||||
RUN apt-get install -y \
|
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:21.10
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
-o APT::Install-Suggests=0 \
|
-o APT::Install-Suggests=0 \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
libsdl-mixer1.2 \
|
libsdl-mixer1.2 \
|
||||||
libsdl-net1.2 \
|
libsdl-net1.2 \
|
||||||
x11vnc \
|
x11vnc \
|
||||||
xvfb \
|
xvfb \
|
||||||
netcat-openbsd
|
netcat-openbsd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
WORKDIR /root/
|
RUN mkdir /root/.vnc && x11vnc -storepasswd idbehold /root/.vnc/passwd
|
||||||
|
COPY --from=build-converge /build /
|
||||||
# Setup a password
|
WORKDIR /root
|
||||||
RUN mkdir ~/.vnc && x11vnc -storepasswd idbehold ~/.vnc/passwd
|
ENTRYPOINT ["/usr/bin/kubedoom"]
|
||||||
|
|
||||||
COPY --from=ubuntu-deps /doom1.wad .
|
|
||||||
COPY --from=ubuntu-deps /usr/bin/kubectl /usr/bin/
|
|
||||||
COPY --from=ubuntu-build /usr/local/games/psdoom /usr/local/games/
|
|
||||||
COPY --from=gobuild /go/src/kubedoom/kubedoom .
|
|
||||||
|
|
||||||
ENTRYPOINT ["/root/kubedoom"]
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -18,8 +19,11 @@ spec:
|
|||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
serviceAccountName: kubedoom
|
serviceAccountName: kubedoom
|
||||||
containers:
|
containers:
|
||||||
- image: storaxdev/kubedoom:0.5.0
|
- image: ghcr.io/storax/kubedoom:latest
|
||||||
name: kubedoom
|
env:
|
||||||
ports:
|
- name: NAMESPACE
|
||||||
- containerPort: 5900
|
value: default
|
||||||
name: vnc
|
name: kubedoom
|
||||||
|
ports:
|
||||||
|
- containerPort: 5900
|
||||||
|
name: vnc
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
Reference in New Issue
Block a user