Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dockerfile): use heredoc run to improve maintainability #49

Merged
merged 1 commit into from Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 26 additions & 15 deletions Dockerfile
Expand Up @@ -3,21 +3,32 @@ ARG TARGETARCH

WORKDIR "/opt/drawio-desktop"

ENV DRAWIO_VERSION "21.8.2"
RUN set -e; \
echo "selected arch: ${TARGETARCH}"; \
apt-get update && apt-get install -y \
xvfb \
wget \
libgbm1 \
libasound2 \
# Fonts
fonts-liberation fonts-arphic-ukai fonts-arphic-uming fonts-noto fonts-noto-cjk fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core \
; wget -q https://github.com/jgraph/drawio-desktop/releases/download/v${DRAWIO_VERSION}/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb \
&& apt-get install -y /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb \
&& rm -rf /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb; \
apt-get remove -y wget; \
rm -rf /var/lib/apt/lists/*;
RUN <<EOF
set -e
echo "selected arch: ${TARGETARCH}"

# Deps
apt-get update
apt-get install -y xvfb wget libgbm1 libasound2

# Drawio Desktop
DRAWIO_VERSION="21.8.2"
wget -q https://github.com/jgraph/drawio-desktop/releases/download/v${DRAWIO_VERSION}/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb
apt-get install -y /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb
rm -rf /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb

# Additional Fonts
apt-get install -y fonts-liberation \
fonts-arphic-ukai fonts-arphic-uming \
fonts-noto fonts-noto-cjk \
fonts-ipafont-mincho fonts-ipafont-gothic \
fonts-unfonts-core

# Cleanup layer
apt-get remove -y wget
rm -rf /var/lib/apt/lists/*

EOF

COPY src/* ./

Expand Down