Skip to content

Commit 98be025

Browse files
authored
Merge pull request #133 from GioF71/132-build-multistage-build
132 build multistage build
2 parents 0991ee2 + d9f6179 commit 98be025

2 files changed

Lines changed: 35 additions & 22 deletions

File tree

Dockerfile

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
ARG BASE_IMAGE
2-
FROM ${BASE_IMAGE}
2+
FROM ${BASE_IMAGE} AS BASE
33
ARG DOWNLOAD_FROM_SOURCEFORGE
44
ARG USE_APT_PROXY
55

6-
RUN mkdir -p /app
7-
RUN mkdir -p /app/bin
86
RUN mkdir -p /app/conf
9-
RUN mkdir -p /app/doc
10-
RUN mkdir -p /app/assets
117

128
COPY app/conf/01-apt-proxy /app/conf/
139

1410
RUN echo "USE_APT_PROXY=["${USE_APT_PROXY}"]"
1511

16-
#if [ "${tag_type}" = "release" ]; then
17-
1812
RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
1913
echo "Builind using apt proxy"; \
2014
cp /app/conf/01-apt-proxy /etc/apt/apt.conf.d/01-apt-proxy; \
@@ -23,6 +17,34 @@ RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
2317
echo "Building without apt proxy"; \
2418
fi
2519

20+
RUN mkdir -p /app/bin
21+
RUN mkdir -p /app/install
22+
COPY install/installer.sh /app/install/
23+
RUN chmod u+x /app/install/*
24+
25+
WORKDIR /app/install
26+
27+
RUN /app/install/installer.sh $DOWNLOAD_FROM_SOURCEFORGE
28+
29+
# remove scripts
30+
RUN rm -Rf /app/install
31+
32+
## test binary in both cases
33+
RUN /app/bin/squeezelite -?
34+
RUN /app/bin/squeezelite-pulseaudio -?
35+
36+
FROM scratch
37+
COPY --from=BASE / /
38+
39+
LABEL maintainer="GioF71"
40+
LABEL source="https://github.com/GioF71/upmpdcli-docker"
41+
42+
RUN mkdir -p /app
43+
RUN mkdir -p /app/bin
44+
RUN mkdir -p /app/conf
45+
RUN mkdir -p /app/doc
46+
RUN mkdir -p /app/assets
47+
2648
ENV SQUEEZELITE_MODE ""
2749
ENV SQUEEZELITE_AUDIO_DEVICE ""
2850
ENV SQUEEZELITE_MIXER_DEVICE ""
@@ -64,21 +86,6 @@ ENV DISPLAY_PRESETS ""
6486
ENV PUID ""
6587
ENV PGID ""
6688

67-
RUN mkdir -p /app/install
68-
COPY install/installer.sh /app/install/
69-
RUN chmod u+x /app/install/*
70-
71-
WORKDIR /app/install
72-
73-
RUN /app/install/installer.sh $DOWNLOAD_FROM_SOURCEFORGE
74-
75-
# remove scripts
76-
RUN rm -Rf /app/install
77-
78-
## test binary in both cases
79-
RUN /app/bin/squeezelite -?
80-
RUN /app/bin/squeezelite-pulseaudio -?
81-
8289
COPY app/bin/run-squeezelite.sh /app/bin/
8390
COPY app/bin/run-squeezelite-alsa.sh /app/bin/
8491
COPY app/bin/run-squeezelite-pulse.sh /app/bin/

RELEASE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ There is roughly a release for each entry of the following changelog. Older buil
66

77
## Changelog
88

9+
### 2022-11-04
10+
11+
Date|Feature|Description
12+
:---|:---|:---
13+
2022-11-04|Build|Multistage build
14+
915
### 2022-11-01
1016

1117
Date|Feature|Description

0 commit comments

Comments
 (0)