Skip to content

Commit

Permalink
Merge pull request #133 from GioF71/132-build-multistage-build
Browse files Browse the repository at this point in the history
132 build multistage build
  • Loading branch information
GioF71 committed Nov 4, 2022
2 parents 0991ee2 + d9f6179 commit 98be025
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
51 changes: 29 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
FROM ${BASE_IMAGE} AS BASE
ARG DOWNLOAD_FROM_SOURCEFORGE
ARG USE_APT_PROXY

RUN mkdir -p /app
RUN mkdir -p /app/bin
RUN mkdir -p /app/conf
RUN mkdir -p /app/doc
RUN mkdir -p /app/assets

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

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

#if [ "${tag_type}" = "release" ]; then

RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
echo "Builind using apt proxy"; \
cp /app/conf/01-apt-proxy /etc/apt/apt.conf.d/01-apt-proxy; \
Expand All @@ -23,6 +17,34 @@ RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
echo "Building without apt proxy"; \
fi

RUN mkdir -p /app/bin
RUN mkdir -p /app/install
COPY install/installer.sh /app/install/
RUN chmod u+x /app/install/*

WORKDIR /app/install

RUN /app/install/installer.sh $DOWNLOAD_FROM_SOURCEFORGE

# remove scripts
RUN rm -Rf /app/install

## test binary in both cases
RUN /app/bin/squeezelite -?
RUN /app/bin/squeezelite-pulseaudio -?

FROM scratch
COPY --from=BASE / /

LABEL maintainer="GioF71"
LABEL source="https://github.com/GioF71/upmpdcli-docker"

RUN mkdir -p /app
RUN mkdir -p /app/bin
RUN mkdir -p /app/conf
RUN mkdir -p /app/doc
RUN mkdir -p /app/assets

ENV SQUEEZELITE_MODE ""
ENV SQUEEZELITE_AUDIO_DEVICE ""
ENV SQUEEZELITE_MIXER_DEVICE ""
Expand Down Expand Up @@ -64,21 +86,6 @@ ENV DISPLAY_PRESETS ""
ENV PUID ""
ENV PGID ""

RUN mkdir -p /app/install
COPY install/installer.sh /app/install/
RUN chmod u+x /app/install/*

WORKDIR /app/install

RUN /app/install/installer.sh $DOWNLOAD_FROM_SOURCEFORGE

# remove scripts
RUN rm -Rf /app/install

## test binary in both cases
RUN /app/bin/squeezelite -?
RUN /app/bin/squeezelite-pulseaudio -?

COPY app/bin/run-squeezelite.sh /app/bin/
COPY app/bin/run-squeezelite-alsa.sh /app/bin/
COPY app/bin/run-squeezelite-pulse.sh /app/bin/
Expand Down
6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ There is roughly a release for each entry of the following changelog. Older buil

## Changelog

### 2022-11-04

Date|Feature|Description
:---|:---|:---
2022-11-04|Build|Multistage build

### 2022-11-01

Date|Feature|Description
Expand Down

0 comments on commit 98be025

Please sign in to comment.