Skip to content

Commit d994587

Browse files
authored
Merge pull request #20 from CubeCoders/wine
fix(wine): simplify images, better deps handling, disable ARM64 for now
2 parents 4d7be3d + a672a57 commit d994587

File tree

8 files changed

+30
-272
lines changed

8 files changed

+30
-272
lines changed

.github/workflows/wine.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
context: .
6565
file: ./wine/common/Dockerfile
66-
platforms: linux/amd64,linux/arm64/v8
66+
platforms: linux/amd64
6767
push: true
6868
pull: true
6969
tags: ghcr.io/cubecoders/amp:wine-common
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
context: .
103103
file: ./wine/${{ matrix.version }}/Dockerfile
104-
platforms: linux/amd64,linux/arm64/v8
104+
platforms: linux/amd64
105105
push: true
106106
pull: true
107107
tags: ghcr.io/cubecoders/amp:wine-${{ matrix.version }}

scripts/wine/find-deps.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ _print_inst() {
1818
' | sort -u
1919
}
2020

21+
STATUS=/tmp/dpkg.status.empty
22+
: > "$STATUS"
23+
2124
case "${BUILD}" in
2225
stable|devel|staging)
23-
apt-get -s install -y -o APT::Install-Recommends=1 "winehq-${BUILD}" \
26+
apt-get -s install -y -o Dir::State::status="$STATUS" -o APT::Install-Recommends=1 "winehq-${BUILD}" \
2427
| _print_inst
2528
;;
2629

@@ -41,7 +44,7 @@ case "${BUILD}" in
4144
exit 2
4245
fi
4346

44-
apt-get -s install -y -o APT::Install-Recommends=1 \
47+
apt-get -s install -y -o Dir::State::status="$STATUS" -o APT::Install-Recommends=1 \
4548
"wine-${WINE_BRANCH}-i386=${WINE_BUILD}" \
4649
"wine-${WINE_BRANCH}-amd64=${WINE_BUILD}" \
4750
"wine-${WINE_BRANCH}=${WINE_BUILD}" \

wine/10-stable/Dockerfile

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,7 @@
11
# Wine image for AMP containers based on Wine 10 stable
22
# ghcr.io/cubecoders/amp:wine-10-stable
33

4-
FROM --platform=linux/amd64 debian:bookworm-slim AS depsfinder
5-
6-
ENV DEBIAN_FRONTEND="noninteractive"
7-
8-
ARG WINE_DIST="bookworm"
9-
ARG WINE_BRANCH="10-stable"
10-
11-
COPY scripts/wine/find-deps.sh /usr/local/bin/find-deps.sh
12-
RUN chmod +x /usr/local/bin/find-deps.sh
13-
14-
RUN set -eux; \
15-
dpkg --add-architecture i386; \
16-
apt-get update; \
17-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \
18-
ca-certificates curl wget gnupg xz-utils; \
19-
install -d -m 0755 /etc/apt/keyrings; \
20-
wget -qO- https://dl.winehq.org/wine-builds/winehq.key \
21-
| gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -; \
22-
wget -NP /etc/apt/sources.list.d/ \
23-
"https://dl.winehq.org/wine-builds/debian/dists/${WINE_DIST}/winehq-${WINE_DIST}.sources"; \
24-
apt-get update; \
25-
\
26-
mkdir -p /tmp/wine-files; \
27-
/usr/local/bin/find-deps.sh "${WINE_BRANCH}" >"/tmp/wine-files/${WINE_BRANCH}.amd64.txt"; \
28-
cp /tmp/wine-files/${WINE_BRANCH}.amd64.txt /tmp/wine-files/wine-deps-amd64.txt
29-
30-
FROM debian:bookworm-slim AS depsmapper
31-
32-
ENV DEBIAN_FRONTEND="noninteractive"
33-
34-
ARG TARGETARCH
35-
36-
COPY --from=depsfinder /tmp/wine-files /tmp/wine-files
37-
38-
COPY scripts/wine/map-x86-deps-to-arm.sh /usr/local/bin/map-x86-deps-to-arm.sh
39-
RUN chmod +x /usr/local/bin/map-x86-deps-to-arm.sh
40-
41-
# Generate dependencies list for arm64
42-
RUN set -eux; \
43-
if [ "${TARGETARCH}" = "arm64" ]; then \
44-
/usr/local/bin/map-x86-deps-to-arm.sh \
45-
< /tmp/wine-files/wine-deps-amd64.txt \
46-
> /tmp/wine-files/wine-deps-arm64.txt; \
47-
fi
48-
49-
FROM ghcr.io/cubecoders/amp:debian
4+
FROM ghcr.io/cubecoders/amp:wine-common
505

516
LABEL org.opencontainers.image.licenses=MIT
527

@@ -58,8 +13,6 @@ ARG WINE_BRANCH="stable"
5813
ARG WINE_LINK="https://dl.winehq.org/wine-builds/debian/pool/main/w/wine/"
5914
ARG WINE_TARGET="10"
6015

61-
COPY --from=depsmapper /tmp/wine-files /tmp/wine-files
62-
6316
# Install additional required packages and Wine 10 stable
6417
RUN set -eux; \
6518
WINE_BUILD="$( \
@@ -70,9 +23,6 @@ RUN set -eux; \
7023
| sort -V | tail -1 \
7124
)"; \
7225
\
73-
apt-get update; \
74-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends cabextract winbind python3; \
75-
\
7626
case "${TARGETARCH}" in \
7727
\
7828
amd64) \
@@ -91,7 +41,7 @@ RUN set -eux; \
9141
\
9242
arm64) \
9343
apt-get update; \
94-
xargs -ra /tmp/wine-files/wine-deps-arm64.txt \
44+
xargs -ra /tmp/wine-files/wine-${WINE_TARGET}-${WINE_BRANCH}-deps-arm64.txt \
9545
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends; \
9646
\
9747
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \

wine/9-stable/Dockerfile

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,7 @@
11
# Wine image for AMP containers based on Wine 9 stable
22
# ghcr.io/cubecoders/amp:wine-9-stable
33

4-
FROM --platform=linux/amd64 debian:bookworm-slim AS depsfinder
5-
6-
ENV DEBIAN_FRONTEND="noninteractive"
7-
8-
ARG WINE_DIST="bookworm"
9-
ARG WINE_BRANCH="9-stable"
10-
11-
COPY scripts/wine/find-deps.sh /usr/local/bin/find-deps.sh
12-
RUN chmod +x /usr/local/bin/find-deps.sh
13-
14-
RUN set -eux; \
15-
dpkg --add-architecture i386; \
16-
apt-get update; \
17-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \
18-
ca-certificates curl wget gnupg xz-utils; \
19-
install -d -m 0755 /etc/apt/keyrings; \
20-
wget -qO- https://dl.winehq.org/wine-builds/winehq.key \
21-
| gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -; \
22-
wget -NP /etc/apt/sources.list.d/ \
23-
"https://dl.winehq.org/wine-builds/debian/dists/${WINE_DIST}/winehq-${WINE_DIST}.sources"; \
24-
apt-get update; \
25-
\
26-
mkdir -p /tmp/wine-files; \
27-
/usr/local/bin/find-deps.sh "${WINE_BRANCH}" >"/tmp/wine-files/${WINE_BRANCH}.amd64.txt"; \
28-
cp /tmp/wine-files/${WINE_BRANCH}.amd64.txt /tmp/wine-files/wine-deps-amd64.txt
29-
30-
FROM debian:bookworm-slim AS depsmapper
31-
32-
ENV DEBIAN_FRONTEND="noninteractive"
33-
34-
ARG TARGETARCH
35-
36-
COPY --from=depsfinder /tmp/wine-files /tmp/wine-files
37-
38-
COPY scripts/wine/map-x86-deps-to-arm.sh /usr/local/bin/map-x86-deps-to-arm.sh
39-
RUN chmod +x /usr/local/bin/map-x86-deps-to-arm.sh
40-
41-
# Generate dependencies list for arm64
42-
RUN set -eux; \
43-
if [ "${TARGETARCH}" = "arm64" ]; then \
44-
/usr/local/bin/map-x86-deps-to-arm.sh \
45-
< /tmp/wine-files/wine-deps-amd64.txt \
46-
> /tmp/wine-files/wine-deps-arm64.txt; \
47-
fi
48-
49-
FROM ghcr.io/cubecoders/amp:debian
4+
FROM ghcr.io/cubecoders/amp:wine-common
505

516
LABEL org.opencontainers.image.licenses=MIT
527

@@ -58,8 +13,6 @@ ARG WINE_BRANCH="stable"
5813
ARG WINE_LINK="https://dl.winehq.org/wine-builds/debian/pool/main/w/wine/"
5914
ARG WINE_TARGET="9"
6015

61-
COPY --from=depsfinder /tmp/wine-files /tmp/wine-files
62-
6316
# Install additional required packages and Wine 9 stable
6417
RUN set -eux; \
6518
WINE_BUILD="$( \
@@ -70,9 +23,6 @@ RUN set -eux; \
7023
| sort -V | tail -1 \
7124
)"; \
7225
\
73-
apt-get update; \
74-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends cabextract winbind python3; \
75-
\
7626
case "${TARGETARCH}" in \
7727
\
7828
amd64) \
@@ -91,7 +41,7 @@ RUN set -eux; \
9141
\
9242
arm64) \
9343
apt-get update; \
94-
xargs -ra /tmp/wine-files/wine-deps-arm64.txt \
44+
xargs -ra /tmp/wine-files/wine-${WINE_TARGET}-${WINE_BRANCH}-deps-arm64.txt \
9545
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends; \
9646
\
9747
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \

wine/common/Dockerfile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ RUN set -eux; \
2424
"https://dl.winehq.org/wine-builds/debian/dists/${WINE_DIST}/winehq-${WINE_DIST}.sources"; \
2525
apt-get update; \
2626
\
27-
mkdir -p /tmp/wine-files; \
2827
for b in ${WINE_BRANCHES}; do \
29-
/usr/local/bin/find-deps.sh "${b}" >"/tmp/wine-files/${b}.amd64.txt"; \
28+
/usr/local/bin/find-deps.sh "${b}" >"/tmp/wine-${b}-deps-amd64.txt"; \
3029
done; \
31-
/usr/local/bin/create-common-deps-list.sh /tmp/wine-files/*.amd64.txt \
32-
> /tmp/wine-files/wine-common-deps-amd64.txt
30+
mkdir -p /tmp/wine-files; \
31+
/usr/local/bin/create-common-deps-list.sh /tmp/wine-*-deps-amd64.txt \
32+
> /tmp/wine-files/wine-common-deps-amd64.txt; \
33+
mv /tmp/wine-*-deps-amd64.txt /tmp/wine-files/
3334

3435
FROM debian:bookworm-slim AS depsmapper
3536

@@ -45,9 +46,14 @@ RUN chmod +x /usr/local/bin/map-x86-deps-to-arm.sh
4546
# Generate common dependencies list for arm64
4647
RUN set -eux; \
4748
if [ "${TARGETARCH}" = "arm64" ]; then \
48-
/usr/local/bin/map-x86-deps-to-arm.sh \
49-
< /tmp/wine-files/wine-common-deps-amd64.txt \
50-
> /tmp/wine-files/wine-common-deps-arm64.txt; \
49+
dpkg --add-architecture armhf; \
50+
apt-get update; \
51+
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \
52+
xz-utils; \
53+
for f in /tmp/wine-files/*-deps-amd64.txt; do \
54+
base="$(basename "$f" -deps-amd64.txt)"; \
55+
/usr/local/bin/map-x86-deps-to-arm.sh "$f" >"/tmp/wine-files/${base}-deps-arm64.txt"; \
56+
done; \
5157
fi
5258

5359
FROM ghcr.io/cubecoders/amp:debian
@@ -67,6 +73,5 @@ RUN set -eux; \
6773
cabextract winbind python3; \
6874
xargs -a "/tmp/wine-files/wine-common-deps-${TARGETARCH}.txt" \
6975
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends; \
70-
rm -rf /tmp/wine-files; \
7176
apt-get clean; \
7277
rm -rf /var/lib/apt/lists/*

wine/devel/Dockerfile

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,7 @@
11
# Wine image for AMP containers based on Wine devel
22
# ghcr.io/cubecoders/amp:wine-devel
33

4-
FROM --platform=linux/amd64 debian:bookworm-slim AS depsfinder
5-
6-
ENV DEBIAN_FRONTEND="noninteractive"
7-
8-
ARG WINE_DIST="bookworm"
9-
ARG WINE_BRANCH="devel"
10-
11-
COPY scripts/wine/find-deps.sh /usr/local/bin/find-deps.sh
12-
RUN chmod +x /usr/local/bin/find-deps.sh
13-
14-
RUN set -eux; \
15-
dpkg --add-architecture i386; \
16-
apt-get update; \
17-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \
18-
ca-certificates curl wget gnupg xz-utils; \
19-
install -d -m 0755 /etc/apt/keyrings; \
20-
wget -qO- https://dl.winehq.org/wine-builds/winehq.key \
21-
| gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -; \
22-
wget -NP /etc/apt/sources.list.d/ \
23-
"https://dl.winehq.org/wine-builds/debian/dists/${WINE_DIST}/winehq-${WINE_DIST}.sources"; \
24-
apt-get update; \
25-
\
26-
mkdir -p /tmp/wine-files; \
27-
/usr/local/bin/find-deps.sh "${WINE_BRANCH}" >"/tmp/wine-files/${WINE_BRANCH}.amd64.txt"; \
28-
cp /tmp/wine-files/${WINE_BRANCH}.amd64.txt /tmp/wine-files/wine-deps-amd64.txt
29-
30-
FROM debian:bookworm-slim AS depsmapper
31-
32-
ENV DEBIAN_FRONTEND="noninteractive"
33-
34-
ARG TARGETARCH
35-
36-
COPY --from=depsfinder /tmp/wine-files /tmp/wine-files
37-
38-
COPY scripts/wine/map-x86-deps-to-arm.sh /usr/local/bin/map-x86-deps-to-arm.sh
39-
RUN chmod +x /usr/local/bin/map-x86-deps-to-arm.sh
40-
41-
# Generate dependencies list for arm64
42-
RUN set -eux; \
43-
if [ "${TARGETARCH}" = "arm64" ]; then \
44-
/usr/local/bin/map-x86-deps-to-arm.sh \
45-
< /tmp/wine-files/wine-deps-amd64.txt \
46-
> /tmp/wine-files/wine-deps-arm64.txt; \
47-
fi
48-
49-
FROM ghcr.io/cubecoders/amp:debian
4+
FROM ghcr.io/cubecoders/amp:wine-common
505

516
LABEL org.opencontainers.image.licenses=MIT
527

@@ -57,8 +12,6 @@ ARG WINE_DIST="bookworm"
5712
ARG WINE_BRANCH="devel"
5813
ARG WINE_LINK="https://dl.winehq.org/wine-builds/debian/pool/main/w/wine/"
5914

60-
COPY --from=depsmapper /tmp/wine-files /tmp/wine-files
61-
6215
# Install additional required packages and Wine devel
6316
RUN set -eux; \
6417
WINE_BUILD="$( \
@@ -68,9 +21,6 @@ RUN set -eux; \
6821
| sort -V | tail -1 \
6922
)"; \
7023
\
71-
apt-get update; \
72-
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends cabextract winbind python3; \
73-
\
7424
case "${TARGETARCH}" in \
7525
\
7626
amd64) \
@@ -85,7 +35,7 @@ RUN set -eux; \
8535
\
8636
arm64) \
8737
apt-get update; \
88-
xargs -ra /tmp/wine-files/wine-deps-arm64.txt \
38+
xargs -ra /tmp/wine-files/wine-${WINE_BRANCH}-deps-arm64.txt \
8939
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends; \
9040
\
9141
apt-get install -o APT::Keep-Downloaded-Packages="false" -y --no-install-recommends \

0 commit comments

Comments
 (0)