-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
117 lines (104 loc) · 3.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
FROM debian:bookworm-slim AS base
# Start a new stage for building the application
FROM base AS builder
# Install required packages
RUN apt-get update --assume-yes \
&& apt-get install --no-install-recommends --assume-yes \
bsdextrautils \
build-essential \
ca-certificates \
curl \
fonts-unifont \
gzip \
libancient-dev \
libbz2-dev \
libcjson-dev \
libdiscid-dev \
libflac-dev \
libfreetype-dev \
libgme-dev \
libjpeg-dev \
libmad0-dev \
libncurses-dev \
libogg-dev \
libpng-dev \
libsdl2-dev \
libvorbis-dev \
libxpm-dev \
pkgconf \
tar \
unzip \
xa65 \
zlib1g-dev
# Set a well-known building directory
WORKDIR /build
# Download and build Open Cubic Player
ARG OCP_URL=https://stian.cubic.org/ocp/ocp-3.0.1.tar.gz
RUN mkdir ocp \
&& curl -sSL "${OCP_URL}" | tar zxf - -C ocp --strip-components=1 \
&& cd ocp \
&& ./configure --prefix=/usr \
--without-desktop_file_install \
--without-oss \
--without-update-desktop-database \
--without-update-mime-database \
&& make -j"$(nproc)" \
&& make install DESTDIR=/build/install \
&& rm -rf /build/install/usr/share/{doc,man}
# Download and prepare image and animation asset files
ARG OCP_IMG_URL=ftp://ftp.cubic.org/pub/player/gfx/opencp25image1.zip \
OCP_ANI_URL=ftp://ftp.cubic.org/pub/player/gfx/opencp25ani1.zip
RUN mkdir ocp-img ocp-ani \
&& curl -sSL "${OCP_IMG_URL}" -o ocp-img/ocp-img.zip \
&& unzip ocp-img/ocp-img.zip -d ocp-img \
&& curl -sSL "${OCP_ANI_URL}" -o ocp-ani/ocp-ani.zip \
&& unzip ocp-ani/ocp-ani.zip -d ocp-ani \
&& cp -pv ocp-img/CPPIC*.TGA ocp-ani/CPANI*.DAT install/usr/share/ocp/data/
# Start a new stage for the application image
FROM base AS ocp
# Configure image labels
LABEL org.opencontainers.image.source=https://github.com/hhromic/opencubicplayer-docker \
org.opencontainers.image.description="Docker images for running the Unix fork of Open Cubic Player." \
org.opencontainers.image.licenses="Apache-2.0 GPL-2.0"
# Configure default command for the image
CMD ["ocp-curses"]
# Configure default environment for the image
ENV LANG="C.UTF-8" \
XDG_CONFIG_HOME=/xdg/config \
XDG_CACHE_HOME=/xdg/cache \
XDG_DATA_HOME=/xdg/data \
XDG_STATE_HOME=/xdg/state
# Install required packages
RUN apt-get update --assume-yes \
&& apt-get install --no-install-recommends --assume-yes \
ca-certificates \
curl \
fonts-unifont \
libancient2 \
libbz2-1.0 \
libcjson1 \
libdiscid0 \
libflac12 \
libfreetype6 \
libgme0 \
libjpeg62-turbo \
libmad0 \
libncurses6 \
libncursesw6 \
libogg0 \
libpng16-16 \
libsdl2-2.0-0 \
libvorbis0a \
libvorbisfile3 \
libxpm4 \
libxxf86vm1 \
&& rm -rf /var/lib/apt/lists/*
# Copy installation files from builder stage
COPY --from=builder /build/install/ /
# Start a new stage for MIDI playback support
FROM ocp AS ocp-midi
# Download and install a soundfont for MIDI playback
ARG SOUNDFONT_URL=https://github.com/mrbumpy409/GeneralUser-GS/raw/refs/heads/main/GeneralUser-GS.sf2
RUN mkdir -p /etc/timidity /usr/share/soundfonts \
&& curl -L "$SOUNDFONT_URL" -o /usr/share/soundfonts/default.sf2 \
&& echo "soundfont /usr/share/soundfonts/default.sf2" > /etc/timidity/timidity.cfg