Skip to content

Commit

Permalink
Enable buildkit cache for package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 7, 2020
1 parent 29b531a commit 2624df2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packaging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# syntax = docker/dockerfile:experimental
#
# Requires Docker v18.06 or later and BuildKit mode to use cache mount
# Docker v18.06 also requires the daemon to be running in experimental mode.
#
# $ export DOCKER_BUILDKIT=1
#
# See https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md
#
# To build for arm, see https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/
#
Expand All @@ -14,10 +22,14 @@ ARG VERSION
RUN git clone --depth=1 -b $VERSION https://github.com/ruediger/VobSub2SRT /source

FROM debian:buster AS build-debian
RUN apt update && apt install -y libtiff5-dev libtesseract-dev tesseract-ocr-eng build-essential cmake pkg-config
RUN --mount=type=cache,id=apt,target=/var/cache/apt \
apt update && apt install -y \
build-essential cmake libtesseract-dev libtiff5-dev pkg-config tesseract-ocr-eng

FROM registry.gitlab.com/pld-linux/pld AS build-pld
RUN poldek -u cmake gzip libtiff-devel make tesseract-devel
RUN --mount=type=cache,id=poldek,target=/var/cache/poldek \
poldek -O 'keep downloads=yes' --up -u \
cmake gzip libtiff-devel make tesseract-devel

FROM build-$TARGET AS build
WORKDIR /build
Expand Down

0 comments on commit 2624df2

Please sign in to comment.