-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (20 loc) · 871 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
FROM ubuntu:focal AS build-env
#prepare build environment
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y build-essential cmake ninja-build git curl unzip tar
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN git clone https://github.com/Microsoft/vcpkg.git /home/build/vcpkg
RUN /home/build/vcpkg/bootstrap-vcpkg.sh
RUN touch /home/build/vcpkg/downloads/AlwaysAllowEverything
RUN /home/build/vcpkg/vcpkg install cpprestsdk
#compile
COPY . /home/build/hello-cpprest/src/
WORKDIR /home/build/hello-cpprest/build
RUN cmake -DCMAKE_TOOLCHAIN_FILE="/home/build/vcpkg/scripts/buildsystems/vcpkg.cmake" ../src
RUN cmake --build .
#create image
FROM ubuntu:focal
COPY --from=build-env /home/build/hello-cpprest/build/hello-cpprest /usr/hello-cpprest/
EXPOSE 8888
WORKDIR /usr/hello-cpprest
ENTRYPOINT ["./hello-cpprest"]