-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
58 lines (44 loc) · 1.98 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# The recipe below implements a Docker multi-stage build:
# <https://docs.docker.com/develop/develop-images/multistage-build/>
###############################################################################
## First stage: an image to build the planner.
##
## We'll install here all packages we need to build the planner
###############################################################################
FROM ubuntu:18.04 AS builder
RUN apt-get update && apt-get install --no-install-recommends -y \
cmake \
ca-certificates \
curl \
g++ \
make \
python3
WORKDIR /workspace/kstar/
# Set up some environment variables.
ENV CXX g++
ENV BUILD_COMMIT_ID baf1aef
# Fetch the code at the right commit ID from the Github repo
RUN curl -L https://github.com/ctpelok77/kstar/archive/${BUILD_COMMIT_ID}.tar.gz | tar xz --strip=1
# Invoke the build script with appropriate options
RUN python3 ./build.py
# Strip the main binary to reduce size
RUN strip --strip-all builds/release/bin/downward
###############################################################################
## Second stage: the image to run the planner
##
## This is the image that will be distributed, we will simply copy here
## the files that we fetched and compiled in the previous image and that
## are strictly necessary to run the planner
###############################################################################
FROM ubuntu:18.04
# Install any package needed to *run* the planner
RUN apt-get update && apt-get install --no-install-recommends -y \
python3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace/kstar/
# Copy the relevant files from the previous docker build into this build.
COPY --from=builder /workspace/kstar/fast-downward.py .
COPY --from=builder /workspace/kstar/builds/release/bin/ ./builds/release/bin/
COPY --from=builder /workspace/kstar/driver ./driver
WORKDIR /work
ENTRYPOINT ["/usr/bin/python3", "/workspace/kstar/fast-downward.py"]