-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
225 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
buildx: | ||
# strategy: | ||
# fail-fast: false | ||
# 1 job at a time since cron depends on latest | ||
# max-parallel: 1 | ||
# matrix: | ||
# tag: | ||
# - latest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@main | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Set Docker Tag | ||
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
|
||
- name: Docker login | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build docker container | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
run: | | ||
curl -fsSL https://raw.githubusercontent.com/pschmitt/ci-setup-docker-buildx/master/setup.sh | bash | ||
./build.sh ${{ matrix.tag }} -p |
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,2 @@ | ||
.idea | ||
|
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,37 @@ | ||
FROM golang:1.14-buster AS easy-novnc-build | ||
WORKDIR /src | ||
RUN go mod init build && \ | ||
go get github.com/geek1011/[email protected] && \ | ||
go build -o /bin/easy-novnc github.com/geek1011/easy-novnc | ||
|
||
FROM debian:buster | ||
|
||
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 | ||
|
||
|
||
|
||
RUN apt-get update -y && \ | ||
wget -q -O /tmp/oscar.deb https://www.apneaboard.com/OSCAR/oscar_1.4.0-Debian10_amd64.deb && \ | ||
apt install -y /tmp/oscar.deb && \ | ||
rm /tmp/oscar.deb && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
COPY --from=easy-novnc-build /bin/easy-novnc /usr/local/bin/ | ||
COPY menu.xml /etc/xdg/openbox/ | ||
COPY supervisord.conf /etc/ | ||
EXPOSE 8080 | ||
|
||
RUN groupadd --gid 1000 app && \ | ||
useradd --home-dir /data --shell /bin/bash --uid 1000 --gid 1000 app && \ | ||
mkdir -p /data | ||
|
||
#VOLUME /data | ||
|
||
CMD ["sh", "-c", "chown app:app /data /dev/stdout && exec gosu app supervisord"] |
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
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,88 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() { | ||
echo "Usage: $0 [cron]" | ||
} | ||
|
||
array_join() { | ||
local IFS="$1" | ||
shift | ||
echo "$*" | ||
} | ||
|
||
get_available_architectures() { | ||
local image="$1" | ||
local tag="${2:-latest}" | ||
|
||
docker buildx imagetools inspect --raw "${image}:${tag}" | \ | ||
jq -r '.manifests[].platform | .os + "/" + .architecture + "/" + .variant' | \ | ||
sed 's#/$##' | sort | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]] | ||
then | ||
set -ex | ||
|
||
cd "$(readlink -f "$(dirname "$0")")" || exit 9 | ||
|
||
# Defaults | ||
DOCKERFILE="${DOCKERFILE:-Dockerfile}" | ||
IMAGE_NAME="${IMAGE_NAME:-rogerrum/docker-oscar}" | ||
TAG="${TAG:-latest}" | ||
|
||
case "$1" in | ||
latest) | ||
DOCKERFILE=Dockerfile | ||
TAG=latest | ||
shift | ||
;; | ||
help|h|--help|-h) | ||
usage | ||
exit 0 | ||
;; | ||
esac | ||
|
||
EXTRA_BUILD_ARGS=() | ||
|
||
case "$1" in | ||
push|p|--push|-p) | ||
EXTRA_BUILD_ARGS+=("--push") | ||
;; | ||
*) | ||
EXTRA_BUILD_ARGS+=("--load") | ||
;; | ||
esac | ||
|
||
# read -r base_image base_tag <<< \ | ||
# "$(sed -nr 's/^FROM\s+([^:]+):?((\w+).*)\s*$/\1 \3/p' "$DOCKERFILE" | head -1)" | ||
# shellcheck disable=2207 | ||
# platforms=($(get_available_architectures "$base_image" "$base_tag")) | ||
platforms=( | ||
linux/amd64 | ||
# linux/arm/v6 | ||
# linux/arm/v7 | ||
# linux/arm64/v8 | ||
) | ||
|
||
BUILD_TYPE=manual | ||
|
||
if [[ "$TRAVIS" == "true" ]] | ||
then | ||
BUILD_TYPE=travis | ||
EXTRA_BUILD_ARGS+=("--no-cache") | ||
elif [[ "$GITHUB_ACTIONS" == "true" ]] | ||
then | ||
BUILD_TYPE=github | ||
EXTRA_BUILD_ARGS+=("--no-cache") | ||
fi | ||
|
||
docker buildx build \ | ||
--file "$DOCKERFILE" \ | ||
--platform "$(array_join "," "${platforms[@]}")" \ | ||
--label=built-by=rogerrum \ | ||
--label=build-type="$BUILD_TYPE" \ | ||
--label=built-on="$HOSTNAME" \ | ||
--tag "${IMAGE_NAME}:${TAG}" \ | ||
"${EXTRA_BUILD_ARGS[@]}" \ | ||
. | ||
fi |
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,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/ file:///usr/share/openbox/menu.xsd"> | ||
<menu id="root-menu" label="Openbox 3"> | ||
<item label="OSCAR"> | ||
<action name="Execute"> | ||
<execute>/usr/bin/OSCAR</execute> | ||
</action> | ||
</item> | ||
<item label="Terminal"> | ||
<action name="Execute"> | ||
<execute>/usr/bin/x-terminal-emulator</execute> | ||
</action> | ||
</item> | ||
<item label="Htop"> | ||
<action name="Execute"> | ||
<execute>/usr/bin/x-terminal-emulator -e htop</execute> | ||
</action> | ||
</item> | ||
</menu> | ||
</openbox_menu> |
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,39 @@ | ||
[supervisord] | ||
nodaemon=true | ||
pidfile=/tmp/supervisord.pid | ||
logfile=/dev/fd/1 | ||
logfile_maxbytes=0 | ||
|
||
[program:x11] | ||
priority=0 | ||
command=/usr/bin/Xtigervnc -desktop "OSCAR" -localhost -rfbport 5900 -SecurityTypes None -AlwaysShared -AcceptKeyEvents -AcceptPointerEvents -AcceptSetDesktopSize -SendCutText -AcceptCutText :0 | ||
autorestart=true | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:easy-novnc] | ||
priority=0 | ||
command=/usr/local/bin/easy-novnc --addr :8080 --host localhost --port 5900 --no-url-password --novnc-params "resize=remote" | ||
autorestart=true | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:openbox] | ||
priority=1 | ||
command=/usr/bin/openbox | ||
environment=DISPLAY=:0 | ||
autorestart=true | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:app] | ||
priority=1 | ||
environment=DISPLAY=:0 | ||
command=/usr/bin/OSCAR | ||
autorestart=true | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true |