Skip to content

Commit

Permalink
refactor(docker): Build docker using prebuilt dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Feb 25, 2020
1 parent c4e040c commit eeb522b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
@@ -1,14 +1,19 @@
ARG sile_tag=master
FROM archlinux AS sile-base

RUN pacman --needed --noconfirm -Syyuq && yes | pacman -Sccq
# Setup Alerque's hosted Arch repository with prebuilt dependencies
RUN pacman-key --init && pacman-key --populate
RUN sed -i -e '/^.community/{n;n;s!^!\n\[alerque\]\nServer = https://arch.alerque.com/$arch\n!}' /etc/pacman.conf
RUN pacman-key --recv-keys 63CC496475267693 && pacman-key --lsign-key 63CC496475267693

COPY build-aux/docker-yay-runner.sh /usr/local/bin
RUN docker-yay-runner.sh "--noconfirm --asexplicit -Sq fontconfig harfbuzz icu lua lua-{cassowary,cosmo,cliargs,expat,filesystem,linenoise,lpeg,luaepnf,penlight,repl,sec,socket,stdlib,vstruct,zlib} ttf-gentium-plus"
RUN pacman --needed --noconfirm -Syuq && yes | pacman -Sccq

# Installing and removing pre-packaged sile bootstraps the system dependencies
RUN pacman --needed --noconfirm -Syq sile && yes | pacman -Sccq && pacman --noconfirm -Rq sile

FROM sile-base AS sile-builder

RUN pacman --needed --noconfirm -Syyuq && pacman --needed --noconfirm -Sq git base-devel poppler && yes | pacman -Sccq
RUN pacman --needed --noconfirm -Syq git base-devel poppler

COPY ./ /src
WORKDIR /src
Expand All @@ -19,7 +24,9 @@ RUN git clean -dxf ||:
RUN git fetch --unshallow ||:
RUN git fetch --tags ||:

RUN ./bootstrap.sh && ./configure --with-system-luarocks && make
RUN ./bootstrap.sh
RUN ./configure --with-system-luarocks
RUN make
RUN make install DESTDIR=/pkgdir

FROM sile-base AS sile
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -327,7 +327,7 @@ endif
CLEANFILES = $(bin_SCRIPTS) $(dist_man_MANS) $(DEPFILES) $(ACTUALS) $(TESTPDFS)

.PHONY: docker
docker: Dockerfile build-aux/docker-entrypoint.sh build-aux/docker-yay-runner.sh
docker: Dockerfile build-aux/docker-entrypoint.sh
docker build --tag siletypesetter/sile:HEAD ./

gource.webm:
Expand Down
20 changes: 0 additions & 20 deletions build-aux/docker-yay-runner.sh

This file was deleted.

0 comments on commit eeb522b

Please sign in to comment.