Skip to content

Commit

Permalink
feat: add initial build script and fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrkhr committed Nov 11, 2024
1 parent 5e6799f commit 119685a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker

on:
push:
tags:
- 'v*'

jobs:
build-and-push-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './Store'
steps:
- name: Checkout repository
uses: actions/checkout@v3
# with:
# ref: ${{ steps.get_tag_name.outputs.VERSION }}

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: "./docker"
#"{{defaultContext}}"
file: "./docker/Dockerfile"
push: true
tags: ghcr.io/matsuolab/virtual_desktop:latest,ghcr.io/matsuolab/virtual_desktop:${{ github.ref_name }}
11 changes: 5 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG UBUNTU_DISTR
FROM ubuntu:22.04
ARG UBUNTU=22.04
FROM ubuntu:${UBUNTU}

ARG UID=1000
ARG GID=1000
Expand All @@ -23,13 +23,12 @@ RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
openbox supervisor gosu locales \
tigervnc-standalone-server \
websockify curl jq && \
websockify curl jq ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/debconf/* /var/log/* /tmp/* /var/tmp/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

RUN cd /opt && curl -Lk https://github.com/novnc/noVNC/archive/refs/tags/v{NOVNC_VERSION}.tar.gz | tar xz && \
rm v${NOVNC_VERSION}.tar.gz && mv noVNC-${NOVNC_VERSION} novnc && \
cp /opt/novnc/vnc.html /opt/novnc/index.html
RUN cd /opt && curl -Lk https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.tar.gz | tar xz && \
mv noVNC-${NOVNC_VERSION} novnc && cp /opt/novnc/vnc.html /opt/novnc/index.html

RUN cd /tmp && VIRTUALGL_VERSION="$(curl -fsSL "https://api.github.com/repos/VirtualGL/virtualgl/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')" && \
curl -fsSL -O "https://github.com/VirtualGL/virtualgl/releases/download/${VIRTUALGL_VERSION}/virtualgl_${VIRTUALGL_VERSION}_amd64.deb" && \
Expand Down

0 comments on commit 119685a

Please sign in to comment.