-
Notifications
You must be signed in to change notification settings - Fork 2
/
DockerfileAlpine
47 lines (39 loc) · 996 Bytes
/
DockerfileAlpine
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
42
43
44
45
46
47
# Start from ubuntu as start image
FROM alpine:latest as intermediate
RUN apk update && apk upgrade && apk add \
cmake \
make \
openssl-dev \
linux-headers \
g++ \
gcc
RUN mkdir -p /var/albot-cpp/lib/Poco
WORKDIR /var/albot-cpp
COPY ./lib/Poco ./lib/Poco
RUN cd lib/Poco && cmake . && cmake --build . -j12
FROM alpine:latest
RUN apk update && apk upgrade && apk add \
cmake \
openssl \
openssl-dev \
nlohmann-json \
rapidjson \
rapidjson-dev \
make \
linux-headers \
g++ \
zlib \
zlib-dev \
gcc
RUN apk del --force fmt fmt-dev
RUN mkdir -p /var/albot-cpp
# Create a work space inside the container
WORKDIR /var/albot-cpp
# Copy the content outside the container (except .dockerignore files) inside the container
COPY . .
COPY --from=intermediate /var/albot-cpp/lib/Poco/ /var/albot-cpp/lib/Poco
RUN cd lib/Poco && cmake --install .
RUN cmake .
RUN cmake --build . -j12
# Define default start app
CMD ["./albot-cpp"]