Skip to content

Commit

Permalink
Merge pull request #21 from Th0masL/master
Browse files Browse the repository at this point in the history
Update versions, add VNC password, improve GitHub Actions
  • Loading branch information
solarkennedy authored Jan 8, 2025
2 parents f29f611 + 645c84c commit 9c3b019
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
template: |
## What’s Changed
$CHANGES
39 changes: 37 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Image CI
on:
push:
branches: [ "master" ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ "master" ]

Expand All @@ -13,6 +15,39 @@ jobs:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

- name: Show informations about this GitHub Event
run: echo "$GIT_JSON_DATA"
env:
GIT_JSON_DATA: ${{ toJson(github) }}

- name: "[TAG] Detect Variables"
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: |
echo COMMIT_SHA_SHORT="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
echo DOCKER_IMAGE_TAG="$( echo ${{ github.event.ref }} | sed -e 's|^refs/tags/||g' | grep -E '^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$' )" >> $GITHUB_ENV
- name: "[OTHER] Detect Variables"
if: ${{ github.event_name != 'push' || github.ref_type != 'tag' }}
run: |
echo COMMIT_SHA_SHORT="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
echo DOCKER_IMAGE_TAG="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and Push the Docker image
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USER }}/wine-x11-novnc-docker:${{ env.COMMIT_SHA_SHORT }}
${{ secrets.DOCKER_HUB_USER }}/wine-x11-novnc-docker:${{ env.DOCKER_IMAGE_TAG }}
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN dpkg --add-architecture i386 && \
apt-get update && apt-get -y install python2 python-is-python2 xvfb x11vnc xdotool wget tar supervisor net-tools fluxbox gnupg2 && \
wget -O - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' |tee /etc/apt/sources.list.d/winehq.list && \
apt-get update && apt-get -y install winehq-stable=7.0.0.0~focal-1 && \
apt-get update && apt-get -y install python3 python-is-python3 xvfb x11vnc xdotool wget tar supervisor net-tools fluxbox gnupg2 && \
echo 'echo -n $HOSTNAME' > /root/x11vnc_password.sh && chmod +x /root/x11vnc_password.sh && \
wget -O - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' | tee /etc/apt/sources.list.d/winehq.list && \
apt-get update && apt-get -y install winehq-stable=7.0.1~focal-1 && \
mkdir /opt/wine-stable/share/wine/mono && wget -O - https://dl.winehq.org/wine/wine-mono/7.0.0/wine-mono-7.0.0-x86.tar.xz | tar -xJv -C /opt/wine-stable/share/wine/mono && \
mkdir /opt/wine-stable/share/wine/gecko && wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.1-x86.msi https://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86.msi && wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.1-x86_64.msi https://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86_64.msi && \
mkdir /opt/wine-stable/share/wine/gecko && wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.2-x86.msi https://dl.winehq.org/wine/wine-gecko/2.47.2/wine-gecko-2.47.2-x86.msi && wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.2-x86_64.msi https://dl.winehq.org/wine/wine-gecko/2.47.2/wine-gecko-2.47.2-x86_64.msi && \
apt-get -y full-upgrade && apt-get clean && rm -rf /var/lib/apt/lists/*
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD supervisord-wine.conf /etc/supervisor/conf.d/supervisord-wine.conf

ENV WINEPREFIX /root/prefix32
ENV WINEARCH win32
ENV DISPLAY :0

WORKDIR /root/
RUN wget -O - https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -xzv -C /root/ && mv /root/noVNC-1.1.0 /root/novnc && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html && \
wget -O - https://github.com/novnc/websockify/archive/v0.9.0.tar.gz | tar -xzv -C /root/ && mv /root/websockify-0.9.0 /root/novnc/utils/websockify
RUN wget -O - https://github.com/novnc/noVNC/archive/v1.3.0.tar.gz | tar -xzv -C /root/ && mv /root/noVNC-1.3.0 /root/novnc && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html && \
wget -O - https://github.com/novnc/websockify/archive/v0.11.0.tar.gz | tar -xzv -C /root/ && mv /root/websockify-0.11.0 /root/novnc/utils/websockify

EXPOSE 8080

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ on the Docker Hub.

## Run It

# Start the container
docker run --rm -p 8080:8080 solarkennedy/wine-x11-novnc-docker

# Show the container ID (this is the VNC password)
docker ps

# Open VNC in your web browser
xdg-open http://localhost:8080

In your web browser you should see the default application, explorer.exe:

In your web browser, type the container ID as password, and then you should see the default application, explorer.exe:

![Explorer Screenshot](https://raw.githubusercontent.com/solarkennedy/wine-x11-novnc-docker/master/screenshot.png)

## Modifying

This is a base image. You should fork or use this base image to run your own
wine programs?
This is a base image. You should fork or use this base image to run your own wine programs?

## Issues

Expand Down
6 changes: 6 additions & 0 deletions supervisord-wine.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[program:explorer]
command=/opt/wine-stable/bin/wine /opt/wine-stable/lib/wine/i386-windows/explorer.exe
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
11 changes: 2 additions & 9 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ stdout_logfile_maxbytes=0
redirect_stderr=true

[program:x11vnc]
command=/usr/bin/x11vnc -noxrecord
command=/usr/bin/x11vnc -noxrecord -usepw -passwdfile cmd:/root/x11vnc_password.sh
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:novnc]
command=/root/novnc/utils/launch.sh --vnc localhost:5900 --listen 8080
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:explorer]
command=/opt/wine-stable/bin/wine /opt/wine-stable/lib/wine/explorer.exe
command=/root/novnc/utils/novnc_proxy --vnc localhost:5900 --listen 8080
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
Expand Down

0 comments on commit 9c3b019

Please sign in to comment.