Skip to content

Commit a0076e7

Browse files
committed
Dockerfile: add a dockerfile that install docurium with its dependencies
1 parent e6b9dfd commit a0076e7

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.gem
2+
pkg

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Dependencies we need available when running
2+
ARG RUN_DEPS="ruby-dev llvm libclang-3.8-dev python-pygments libffi6"
3+
4+
FROM debian:stretch-slim as builder
5+
6+
# Extra dependencies we need in the build container
7+
ARG BUILD_DEPS="git cmake pkg-config build-essential libffi-dev libssl-dev"
8+
9+
# takes the global value defined above
10+
ARG RUN_DEPS
11+
12+
# We need these packages to build ruby extensions, rugged and to parse the C
13+
# code. pygments is there to highlight the code examples.
14+
RUN apt update && \
15+
apt install -y --no-install-recommends ${BUILD_DEPS} ${RUN_DEPS} && \
16+
apt clean && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
WORKDIR /docurium
20+
21+
# This is here so we can provide a unique argument per run so docker does not
22+
# consider the rest of the file cached and wealways install the latest version
23+
# of docurium
24+
ARG CACHEBUST=1
25+
26+
COPY . /docurium/
27+
RUN gem build docurium && gem install docurium-*.gem --no-ri --no-rdoc
28+
29+
FROM debian:stretch-slim
30+
31+
# takes the global value defined above
32+
ARG RUN_DEPS
33+
RUN apt update && \
34+
apt install -y --no-install-recommends ${RUN_DEPS} && \
35+
apt clean && \
36+
rm -rf /var/lib/apt/lists/*
37+
38+
COPY --from=builder /var/lib/gems/ /var/lib/gems/
39+
COPY --from=builder /usr/local/bin/cm /usr/local/bin/cm

0 commit comments

Comments
 (0)