Skip to content

Commit

Permalink
refactor: optimize Dockerfiles (#139)
Browse files Browse the repository at this point in the history
* reduce layers of Dockerfile

* remove release version from useragent

* update changelog

* remove release_version from dockerfile

* optimizations

* fix errors
  • Loading branch information
traktuner authored Mar 29, 2024
1 parent 3d25c59 commit 32672d9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 64 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 1.8.1

### Changed
- Optimize Dockerfiles to reduce layer count

## 1.8 - 2024-03-15

### Changed
- Update Backblaze automatically in the background
- Make startapp log file location configurable by an env var (#129, thanks @brokeh)

## 1.7.2 - 2024-02-24

### Changed
- Update known-good Backblaze version to 9.0.1.767
- Update Backblaze in the background
- Mark ubuntu18 tag as "End of Life" and remove ubuntu18 specific troubleshooting from readme


## 1.7.1 - 2024-02-15

### Changed
Expand All @@ -31,7 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> This download of the new version may take some time, so you will only see a black screen until the download is finished. After that, the installer appears and you can update Backblaze by clicking on "install".
- Fix error `Make sure that your X server is running and that $DISPLAY is set correctly` when running basic CLI commands like `winecfg` by adding the DISPLAY environment variable to the Dockerfiles


## 1.6 - 2024-01-22

### Added
Expand Down
33 changes: 13 additions & 20 deletions Dockerfile.ubuntu18
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,21 @@ ENV WINEDEBUG -all
# Set DISPLAY to allow GUI programs to be run
ENV DISPLAY=:0

RUN apt-get update

RUN apt-get install -y curl software-properties-common gnupg2 winbind xvfb

RUN dpkg --add-architecture i386
RUN curl -O https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
RUN apt-get update
RUN apt-get install -y winehq-stable=8.0.1*

RUN apt-get install -y winetricks

RUN apt-get clean -y && apt-get autoremove -y

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
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/ bionic main' && \
apt-get install -y winehq-stable=8.0.1* && \
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
update-locale LANG=en_US.UTF-8 && \
apt-get clean -y && apt-get autoremove -y

EXPOSE 5900

COPY startapp.sh PINNED_BZ_VERSION RELEASE_VERSION /
COPY startapp.sh PINNED_BZ_VERSION /
RUN chmod +x /startapp.sh
33 changes: 13 additions & 20 deletions Dockerfile.ubuntu20
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,21 @@ ENV WINEDEBUG -all
# Set DISPLAY to allow GUI programs to be run
ENV DISPLAY=:0

RUN apt-get update

RUN apt-get install -y curl software-properties-common gnupg2 winbind xvfb

RUN dpkg --add-architecture i386
RUN curl -O https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
RUN apt-get update
RUN apt-get install -y winehq-stable=9.0*

RUN apt-get install -y winetricks

RUN apt-get clean -y && apt-get autoremove -y

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
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/ focal 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
update-locale LANG=en_US.UTF-8 && \
apt-get clean -y && apt-get autoremove -y

EXPOSE 5900

COPY startapp.sh PINNED_BZ_VERSION RELEASE_VERSION /
COPY startapp.sh PINNED_BZ_VERSION /
RUN chmod +x /startapp.sh
33 changes: 13 additions & 20 deletions Dockerfile.ubuntu22
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,21 @@ ENV WINEDEBUG -all
# Set DISPLAY to allow GUI programs to be run
ENV DISPLAY=:0

RUN apt-get update

RUN apt-get install -y curl software-properties-common gnupg2 winbind xvfb

RUN dpkg --add-architecture i386
RUN curl -O https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ jammy main'
RUN apt-get update
RUN apt-get install -y winehq-stable=9.0*

RUN apt-get install -y winetricks

RUN apt-get clean -y && apt-get autoremove -y

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
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/ jammy 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
update-locale LANG=en_US.UTF-8 && \
apt-get clean -y && apt-get autoremove -y

EXPOSE 5900

COPY startapp.sh PINNED_BZ_VERSION RELEASE_VERSION /
COPY startapp.sh PINNED_BZ_VERSION /
RUN chmod +x /startapp.sh
1 change: 0 additions & 1 deletion RELEASE_VERSION

This file was deleted.

3 changes: 1 addition & 2 deletions startapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
set -x

# Define globals
release_version=$(cat "/RELEASE_VERSION") #backblaze-personal-wine version tag
local_version_file="${WINEPREFIX}dosdevices/c:/ProgramData/Backblaze/bzdata/bzreports/bzserv_version.txt"
install_exe_path="${WINEPREFIX}dosdevices/c:/"
log_file="${STARTUP_LOGFILE:-${WINEPREFIX}dosdevices/c:/backblaze-wine-startapp.log}"
custom_user_agent="backblaze-personal-wine/$release_version (JonathanTreffler, +https://github.com/JonathanTreffler/backblaze-personal-wine-container), CFNetwork"
custom_user_agent="backblaze-personal-wine (JonathanTreffler, +https://github.com/JonathanTreffler/backblaze-personal-wine-container), CFNetwork"

# Extracting variables from the PINNED_VERSION file
pinned_bz_version_file="/PINNED_BZ_VERSION"
Expand Down

0 comments on commit 32672d9

Please sign in to comment.