-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
41 lines (29 loc) · 896 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# The new base image to contain common runtime dependencies
FROM alpine:edge AS base
RUN apk add --no-cache \
libgomp
WORKDIR /app
# The first stage will install build dependencies on top of the
# runtime dependencies, and then compile
FROM base AS builder
RUN apk add --no-cache \
gcc \
make \
musl-dev \
curl-dev \
libconfig-dev
COPY . .
RUN make
# The second stage will already contain all dependencies, just copy
# the compiled executables
FROM base
RUN apk add --no-cache \
libcurl \
libconfig \
sed
COPY --from=builder /app/recipesAtHome /app/config.txt /app/
# backwards compatibility (from https://success.docker.com/article/use-a-script-to-initialize-stateful-container-data)
COPY entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh /
VOLUME [ "/config" ]
ENTRYPOINT [ "docker-entrypoint.sh" ]