21 lines
738 B
Docker
21 lines
738 B
Docker
FROM ubuntu
|
|
|
|
# Setting entry point to the app binary
|
|
ENTRYPOINT ["/usr/local/bin/HelloWorldApp"]
|
|
|
|
# Install cmake to manage the build process. Removing cache by `docker builder prune`
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends g++ make cmake
|
|
|
|
# Copy all source files from the current directory to /app in the image
|
|
COPY CMakeLists.txt .
|
|
COPY src ./src
|
|
|
|
# Configuring, building and install the app
|
|
RUN cmake . \
|
|
&& make \
|
|
&& make install
|