Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: alpine image #168

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile: [ubuntu22, ubuntu20, ubuntu18]
dockerfile: [ubuntu22, ubuntu20, ubuntu18, alpine]
include:
- dockerfile: ubuntu22
tags: |
Expand All @@ -36,6 +36,8 @@ jobs:
tags: ubuntu20
- dockerfile: ubuntu18
tags: ubuntu18
- dockerfile: alpine
tags: alpine

steps:
- name: Checkout repository
Expand All @@ -45,7 +47,7 @@ jobs:
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@5138f76647652447004da686b2411557eaf65f33
uses: docker/setup-buildx-action@abe89fb761023d1d963c81f6b5e0df54236dc097

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 1.12

### Added
- Alpine image based on Alpine 3.20 with Wine 9.0
This is a very lightweight image that is about 80% smaller than the default image based on Ubuntu 22.04.
> [!NOTE]
> The Alpine image is currently in early development and may contain bugs.


## 1.11

### Changed
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM jlesage/baseimage-gui:alpine-3.20-v4.6.4@sha256:bc47da3cc4439679e338f9c87d71cbec658485ab564280fb210a6c36af4b128d

ENV WINEPREFIX /config/wine/
ENV APP_NAME="Backblaze Personal Backup"
ENV FORCE_LATEST_UPDATE="true"
ENV DISABLE_AUTOUPDATE="true"
ENV DISABLE_VIRTUAL_DESKTOP="true"
ENV DISPLAY_WIDTH="900"
ENV DISPLAY_HEIGHT="700"
# Disable WINE Debug messages
ENV WINEDEBUG -all
# Set DISPLAY to allow GUI programs to be run
ENV DISPLAY=:0

RUN apk update && \
apk add --no-cache \
curl \
wine=9.0-r0 \
samba \
xvfb \
dpkg \
dpkg \
&& apk add --no-cache --virtual .build-deps \
&& curl -Lo /usr/local/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
&& chmod +x /usr/local/bin/winetricks \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/*

COPY rootfs/ /
RUN chmod +x /startapp.sh
8 changes: 3 additions & 5 deletions Dockerfile.ubuntu18
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM jlesage/baseimage-gui:ubuntu-18.04-v4@sha256:8db7852ce0299e6e8ca956ef4f20dcb0ab1064f7431300e454d0f4535756334f
FROM jlesage/baseimage-gui:ubuntu-18.04-v4.6.4@sha256:426931774d9079a0f10540d02dd623356f4a2bea3d6b47c59adf1be4dbed1741

ENV WINEPREFIX /config/wine/
ENV LANG en_US.UTF-8
ENV APP_NAME="Backblaze Personal Backup"
ENV FORCE_LATEST_UPDATE="false"
ENV FORCE_LATEST_UPDATE="true"
ENV DISABLE_AUTOUPDATE="true"
ENV DISABLE_VIRTUAL_DESKTOP="false"
ENV DISABLE_VIRTUAL_DESKTOP="true"
ENV DISPLAY_WIDTH="900"
ENV DISPLAY_HEIGHT="700"
# Disable WINE Debug messages
Expand All @@ -26,7 +26,5 @@ RUN apt-get update && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

EXPOSE 5900

COPY rootfs/ /
RUN chmod +x /startapp.sh
7 changes: 2 additions & 5 deletions Dockerfile.ubuntu20
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM jlesage/baseimage-gui:ubuntu-20.04-v4@sha256:7727052607e9b69eeb1bfce717effa1e3abf725b431118ff35226bc63a1c72e8

FROM jlesage/baseimage-gui:ubuntu-20.04-v4.6.4@sha256:87fc1dcc97715b0e173739db41cd54b837d82269ff4e43b733d7f9c3d3ea7146
ENV WINEPREFIX /config/wine/
ENV LANG en_US.UTF-8
ENV APP_NAME="Backblaze Personal Backup"
ENV FORCE_LATEST_UPDATE="true"
ENV DISABLE_AUTOUPDATE="true"
ENV DISABLE_VIRTUAL_DESKTOP="false"
ENV DISABLE_VIRTUAL_DESKTOP="true"
ENV DISPLAY_WIDTH="900"
ENV DISPLAY_HEIGHT="700"
# Disable WINE Debug messages
Expand All @@ -26,7 +25,5 @@ RUN apt-get update && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

EXPOSE 5900

COPY rootfs/ /
RUN chmod +x /startapp.sh
6 changes: 2 additions & 4 deletions Dockerfile.ubuntu22
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM jlesage/baseimage-gui:ubuntu-22.04-v4@sha256:51c11dd8405ec18c65b85808ede782e548d8233705c7fb3a62d0dcf0abca55c3
FROM jlesage/baseimage-gui:ubuntu-22.04-v4.6.4@sha256:881989d1f776bdf467b6dc168878a094456935076c9969caaaf045fda9ea98cb

ENV WINEPREFIX /config/wine/
ENV LANG en_US.UTF-8
ENV APP_NAME="Backblaze Personal Backup"
ENV FORCE_LATEST_UPDATE="true"
ENV DISABLE_AUTOUPDATE="true"
ENV DISABLE_VIRTUAL_DESKTOP="false"
ENV DISABLE_VIRTUAL_DESKTOP="true"
ENV DISPLAY_WIDTH="900"
ENV DISPLAY_HEIGHT="700"
# Disable WINE Debug messages
Expand All @@ -26,7 +26,5 @@ RUN apt-get update && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

EXPOSE 5900

COPY rootfs/ /
RUN chmod +x /startapp.sh
30 changes: 30 additions & 0 deletions Dockerfile.ubuntu24
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM jlesage/baseimage-gui:ubuntu-24.04-v4.6.4@sha256:eaf36bd09e64d8241f8f0bc56d035631497e3cc09e4817e697999b32a70b1ab4

ENV WINEPREFIX /config/wine/
ENV LANG en_US.UTF-8
ENV APP_NAME="Backblaze Personal Backup"
ENV FORCE_LATEST_UPDATE="true"
ENV DISABLE_AUTOUPDATE="true"
ENV DISABLE_VIRTUAL_DESKTOP="true"
ENV DISPLAY_WIDTH="900"
ENV DISPLAY_HEIGHT="700"
# Disable WINE Debug messages
ENV WINEDEBUG -all
# Set DISPLAY to allow GUI programs to be run
ENV DISPLAY=:0

RUN apt-get update && \
apt-get install -y curl software-properties-common gnupg2 winbind xvfb && \
dpkg --add-architecture i386 && \
curl -O https://dl.winehq.org/wine-builds/winehq.key && \
apt-key add winehq.key && \
add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ noble main' && \
apt-get install -y winehq-stable=9.0* && \
apt-get install -y winetricks && \
DEBIAN_FRONTEND=noninteractive apt-get install -y locales && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

COPY rootfs/ /
RUN chmod +x /startapp.sh
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ Here are the main components of this image:
| ubuntu22 | Latest stable version of the image based on ubuntu 22 |
| ubuntu20 | Latest stable version of the image based on ubuntu 20 |
| ubuntu18 | Latest stable version of the image based on ubuntu 18 **(End of Life - unmaintained)** |
| alpine | Very lightweight image based on Alpine Linux **(in development - may contain bugs)** |
| v1.x | Versioned stable releases based on ubuntu 22 |
| main | Automatic build of the main branch (may be unstable) based on ubuntu 22 |

There are no versioned ubuntu20 or ubuntu18 builds.
There are no versioned ubuntu20, ubuntu18 or alpine builds.
All tags are usually easily interchangeable.

### Platforms

Expand All @@ -102,7 +104,7 @@ Environment variables can be set by adding one or more arguments `-e "<VAR>=<VAL

| Variable | Description | Default |
|----------------|----------------------------------------------|---------|
|`DISABLE_VIRTUAL_DESKTOP` | Disables Wine's Virtual Desktop Mode | false |
|`DISABLE_VIRTUAL_DESKTOP` | Disables Wine's Virtual Desktop Mode | true |
|`DISABLE_AUTOUPDATE` | Disables the auto-update of the backblaze client to the latest known-good version at the time of the docker version release | true |
|`FORCE_LATEST_UPDATE`| Forces the auto updater to download the newest version of the backblaze client from the backblaze servers instead of a known-good version from the Internet Archive | true |
|`UMASK`| Mask that controls how file permissions are set for newly created files. The value of the mask is in octal notation. By default, this variable is not set and the default umask of `022` is used, meaning that newly created files are readable by everyone, but only writable by the owner. See the following online umask calculator: http://wintelguy.com/umask-calc.pl | (unset) |
Expand Down
61 changes: 43 additions & 18 deletions rootfs/startapp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -x

# Define globals
Expand All @@ -16,6 +16,15 @@ export FORCE_LATEST_UPDATE="true" #disable pinned version since URL is excluded
export WINEARCH="win64"
export WINEDLLOVERRIDES="mscoree=" # Disable Mono installation

# Determine the Linux distribution
if [ -f /etc/alpine-release ]; then
DISTRO="alpine"
elif [ -f /etc/debian_version ]; then
DISTRO="debian"
else
DISTRO=$(grep -i '^ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | tr '[:upper:]' '[:lower:]')
fi

log_message() {
echo "$(date): $1" >> "$log_file"
}
Expand All @@ -37,19 +46,23 @@ do
done

# Set Virtual Desktop
cd $WINEPREFIX
if [ "$DISABLE_VIRTUAL_DESKTOP" = "true" ]; then
log_message "WINE: DISABLE_VIRTUAL_DESKTOP=true - Virtual Desktop mode will be disabled"
winetricks vd=off
else
# Check if width and height are defined
if [ -n "$DISPLAY_WIDTH" ] && [ -n "$DISPLAY_HEIGHT" ]; then
log_message "WINE: Enabling Virtual Desktop mode with $DISPLAY_WIDTH:$DISPLAY_WIDTH aspect ratio"
winetricks vd="$DISPLAY_WIDTH"x"$DISPLAY_HEIGHT"
else
# Default aspect ratio
log_message "WINE: Enabling Virtual Desktop mode with recommended aspect ratio"
winetricks vd="900x700"
if [ "$DISTRO" != "alpine" ]; then
if [ -f "${WINEPREFIX}drive_c/Program Files (x86)/Backblaze/bzbui.exe" ]; then
cd $WINEPREFIX
if [ "$DISABLE_VIRTUAL_DESKTOP" = "true" ]; then
log_message "WINE: DISABLE_VIRTUAL_DESKTOP=true - Virtual Desktop mode will be disabled"
winetricks vd=off
else
# Check if width and height are defined
if [ -n "$DISPLAY_WIDTH" ] && [ -n "$DISPLAY_HEIGHT" ]; then
log_message "WINE: Enabling Virtual Desktop mode with $DISPLAY_WIDTH:$DISPLAY_HEIGHT aspect ratio"
winetricks vd="$DISPLAY_WIDTH"x"$DISPLAY_HEIGHT"
else
# Default aspect ratio
log_message "WINE: Enabling Virtual Desktop mode with recommended aspect ratio"
winetricks vd="900x700"
fi
fi
fi
fi

Expand Down Expand Up @@ -83,12 +96,24 @@ fetch_and_install() {
fi
log_message "INSTALLER: Starting install_backblaze.exe"
if [ -f "${WINEPREFIX}drive_c/Program Files (x86)/Backblaze/bzbui.exe" ]; then
WINEARCH="$WINEARCH" WINEPREFIX="$WINEPREFIX" wine64 "install_backblaze.exe" -nogui || handle_error "INSTALLER: Failed to install Backblaze"
WINEARCH="$WINEARCH" WINEPREFIX="$WINEPREFIX" wine64 "install_backblaze.exe" -nogui &
else
WINEARCH="$WINEARCH" WINEPREFIX="$WINEPREFIX" wine64 "install_backblaze.exe" || handle_error "INSTALLER: Failed to install Backblaze"
WINEARCH="$WINEARCH" WINEPREFIX="$WINEPREFIX" wine64 "install_backblaze.exe" &
fi

}
log_message "INSTALLER: Waiting for installer to finish"
# Wait for the installer to start
while [ "$(pgrep bzdoinstall)" = "" ]
do
sleep 1
done
# Wait for the bzgui to start
while [ "$(pgrep bzbui)" = "" ]
do
sleep 1
done
# Now that the install is complete and the UI frozen, wait 30 seconds and restart the app
sleep 30
kill $(pgrep bzbui) $(pgrep bzdoinstall) $(pgrep install_backblaze)

start_app() {
log_message "STARTAPP: Starting Backblaze version $(cat "$local_version_file")"
Expand Down