Skip to content

Commit

Permalink
Using heredoc instead of long string of commands
Browse files Browse the repository at this point in the history
Also, added an option (set -x) to print the expanded command that is run
in the heredoc.
  • Loading branch information
vlulla committed Nov 8, 2023
1 parent 36974e3 commit 443b7fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
30 changes: 23 additions & 7 deletions lilypond/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,32 @@ LABEL maintainer "Vijay Lulla <[email protected]>"
## Run : docker run --rm -it --name lilypond lilypond
ARG DEBIAN_FRONTEND=noninteractive

SHELL ["bash", "-c"]

## ENV DISPLAY :0
RUN apt-get update -qq -y && apt-get install -y --no-install-recommends build-essential vim-tiny texlive-base flex ca-certificates && \
apt-get install -y --no-install-recommends perl guile-3.0 guile-3.0-dev guile-2.2 guile-2.2-dev python3 flex bison ghostscript imagemagick zip rsync dblatex libpango1.0-dev \
fonts-texgyre tidy extractpdfmark texlive-metapost curl fontforge texlive-lang-cyrillic gettext texinfo texi2html install-info texlive-xetex tini libfl-dev texlive-font-utils && \
rm -rf /var/lib/apt/lists/*
RUN <<EOT
set -ex
apt-get update -qq -y
apt-get install -y --no-install-recommends build-essential vim-tiny texlive-base flex ca-certificates
apt-get install -y --no-install-recommends perl guile-3.0 guile-3.0-dev guile-2.2 guile-2.2-dev python3 flex bison ghostscript imagemagick zip rsync dblatex libpango1.0-dev fonts-texgyre tidy extractpdfmark texlive-metapost curl fontforge texlive-lang-cyrillic gettext texinfo texi2html install-info texlive-xetex tini libfl-dev texlive-font-utils
rm -rf /var/lib/apt/lists/*
EOT

WORKDIR /tmp
RUN curl -SL -O https://lilypond.org/download/source/v2.24/lilypond-2.24.1.tar.gz && tar xf lilypond-2.24.1.tar.gz && \
cd lilypond-2.24.1 && mkdir -p build && cd build && ../autogen.sh --noconfigure && ../configure && make -j 2 all && make install && \
cd /tmp && rm -rf lilypond-2.24.1 lilypond-2.24.1.tar.gz
RUN <<EOT
set -ex
curl -SL -O https://lilypond.org/download/source/v2.24/lilypond-2.24.2.tar.gz
tar xf lilypond-2.24.2.tar.gz
cd lilypond-2.24.2
mkdir -p build
cd build
../autogen.sh --noconfigure
../configure
make -j $(( $(nproc) - 2)) all
make install
cd /tmp
rm -rf lilypond-2.24.2 lilypond-2.24.2.tar.gz
EOT

## RUN apt-get install -y iproute2 net-tools iputils-ping

Expand Down
2 changes: 1 addition & 1 deletion lilypond/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.DEFAULT: all

all: Dockerfile
sed -e "s/^ARG UID=/&$$(id -u)/g;s/^ARG GID=/&$$(id -g)/g;s/^ARG USER=/&$$(id -un)/g;s/^ARG GROUP=/&$$(id -gn)/g" $< | docker buildx build -t lilypond -f - .
sed -e "s/^ARG UID=/&$$(id -u)/g;s/^ARG GID=/&$$(id -g)/g;s/^ARG USER=/&$$(id -un)/g;s/^ARG GROUP=/&$$(id -gn)/g" $< | docker buildx build --progress=plain -t lilypond -f - .
clean:
@echo "Do cleaning here"
docker rmi lilypond ubuntu
Expand Down

0 comments on commit 443b7fb

Please sign in to comment.