-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from rogerrum/update
Docker OSCAR updates
- Loading branch information
Showing
19 changed files
with
472 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: | ||
- 'main' | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
rogerrum/docker-oscar | ||
ghcr.io/rogerrum/docker-oscar | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Output platforms | ||
run: | | ||
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Docker Hub Description | ||
if: github.event_name != 'pull_request' | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
repository: rogerrum/docker-oscar | ||
|
||
# Trivy test | ||
- name: Run Trivy vulnerability scanner | ||
if: github.event_name != 'pull_request' | ||
uses: aquasecurity/trivy-action@master | ||
id: trivy | ||
with: | ||
image-ref: 'ghcr.io/rogerrum/docker-oscar:${{ steps.meta.outputs.version }}' | ||
format: 'sarif' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
output: results.sarif | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
sarif_file: 'results.sarif' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
FROM golang:1.19-bullseye AS easy-novnc-build | ||
WORKDIR /src | ||
RUN go mod init build && \ | ||
go get github.com/geek1011/easy-novnc@v1.1.0 && \ | ||
go build -o /bin/easy-novnc github.com/geek1011/easy-novnc | ||
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye | ||
|
||
FROM debian:bullseye | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends openbox tigervnc-standalone-server supervisor gosu && \ | ||
rm -rf /var/lib/apt/lists && \ | ||
mkdir -p /usr/share/desktop-directories | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends lxterminal nano wget openssh-client rsync ca-certificates xdg-utils htop tar xzip gzip bzip2 zip unzip && \ | ||
rm -rf /var/lib/apt/lists | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
ARG OSCAR_VERSION=1.5.1 | ||
|
||
RUN printf '%s' "Building for TARGETPLATFORM=${TARGETPLATFORM}" \ | ||
&& printf '%s' ", TARGETARCH=${TARGETARCH}" \ | ||
&& printf '%s' ", TARGETVARIANT=${TARGETVARIANT} \n" | ||
|
||
RUN apt-get update -y && \ | ||
wget -q -O /tmp/oscar.deb https://www.apneaboard.com/OSCAR/oscar_1.4.0-Debian11_amd64.deb && \ | ||
apt install -y /tmp/oscar.deb && \ | ||
rm /tmp/oscar.deb && \ | ||
rm -rf /var/lib/apt/lists | ||
apt-get install -y --no-install-recommends wget cron | ||
|
||
COPY --from=easy-novnc-build /bin/easy-novnc /usr/local/bin/ | ||
COPY menu.xml /etc/xdg/openbox/ | ||
COPY supervisord.conf /etc/ | ||
EXPOSE 8080 | ||
RUN if [ "${TARGETARCH}" = "arm64" ]; then \ | ||
wget -q -O /tmp/oscar.deb https://www.apneaboard.com/OSCAR/oscar_${OSCAR_VERSION}-RasPiOS-11_arm64.deb; \ | ||
else \ | ||
wget -q -O /tmp/oscar.deb https://www.apneaboard.com/OSCAR/oscar_${OSCAR_VERSION}-Debian11_amd64.deb; \ | ||
fi | ||
|
||
RUN groupadd --gid 1000 app && \ | ||
useradd --home-dir /data --shell /bin/bash --uid 1000 --gid 1000 app && \ | ||
mkdir -p /data | ||
RUN apt install -y /tmp/oscar.deb && \ | ||
rm /tmp/oscar.deb && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
#VOLUME /data | ||
#RUN apk add --no-cache firefox | ||
COPY /root / | ||
|
||
CMD ["sh", "-c", "chown app:app /data /dev/stdout && exec gosu app supervisord"] | ||
# ports and volumes | ||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.