1
- # syntax = docker/dockerfile:1.2
2
- # Dockerfile.jammy
1
+ # syntax = docker/dockerfile:1.4.3
2
+ # Dockerfile.ubuntu
3
3
#
4
4
# This file acts partly as a Docker recipe for building Cloe on Ubuntu.
5
+ # It is known to work with Ubuntu 18.04, 20.04, and 22.04.
5
6
#
6
7
# If you are behind a proxy, make sure to pass in the respective HTTP_PROXY,
7
8
# HTTPS_PROXY, and NO_PROXY variables.
8
-
9
- # This is a work-around to not being able to use variables in RUN --mount=from:
10
- # If you want to use VTD in this image, you need to specify the Docker image
11
- # containing the distribution that can be mounted at /root/.conan/data/
12
- ARG VTD_IMAGE=scratch
13
- FROM ${VTD_IMAGE} AS vtd
14
- WORKDIR /vtd
15
-
16
- FROM ubuntu:22.04
9
+ ARG UBUNTU_VERSION=20.04
10
+ FROM ubuntu:${UBUNTU_VERSION}
17
11
18
12
# Install System Packages
19
13
#
20
14
# These packages are required for building and testing Cloe.
21
15
COPY Makefile.help /cloe/Makefile.help
22
16
COPY Makefile.setup /cloe/Makefile.setup
23
- RUN --mount=type=cache,id=focal -cache,target=/var/cache/apt \
24
- --mount=type=cache,id=focal -lib,target=/var/lib/apt \
17
+ RUN --mount=type=cache,id=ubuntu-${UBUNTU_VERSION} -cache,target=/var/cache/apt \
18
+ --mount=type=cache,id=ubuntu-${UBUNTU_VERSION} -lib,target=/var/lib/apt \
25
19
apt-get update && \
26
- apt-get install -y make ccache locales && \
20
+ apt-get install -y make ccache locales libbsd0 && \
27
21
make -f /cloe/Makefile.setup \
28
22
DEBIAN_FRONTEND=noninteractive \
29
23
APT_ARGS="--no-install-recommends -y" \
30
- install-system-deps \
31
- && \
24
+ install-system-deps && \
32
25
locale-gen && \
33
26
rm -rf /var/lib/apt/lists/*
34
27
@@ -45,8 +38,10 @@ RUN pip3 install --upgrade pip && \
45
38
# Install and Setup Conan
46
39
#
47
40
# You may not want to use the default Conan remote (conan-center), so we use
48
- # whatever is stored in the build arguments CONAN_REMOTE. Currently, only
49
- # anonymous access is possible in this Dockerfile.
41
+ # whatever is stored in the build arguments CONAN_REMOTE.
42
+ #
43
+ # If you need to login to a Conan remote, make use of the setup.sh file, which
44
+ # will be sourced for every run argument that uses the conan command.
50
45
#
51
46
# The following profiles are available: default, cloe-release, cloe-debug
52
47
COPY dist/conan /cloe/dist/conan
@@ -62,7 +57,6 @@ RUN make -f /cloe/Makefile.setup setup-conan && \
62
57
# Makefile at the root of the repository. This also acts as a form of
63
58
# documentation.
64
59
WORKDIR /cloe
65
- ARG WITH_VTD=0
66
60
ARG KEEP_SOURCES=0
67
61
68
62
# Download or build dependencies:
@@ -72,9 +66,8 @@ COPY Makefile.all /cloe
72
66
ARG VENDOR_TARGET="export-vendor download-vendor"
73
67
RUN --mount=type=cache,target=/ccache \
74
68
--mount=type=secret,target=/root/setup.sh,id=setup,mode=0400 \
75
- --mount=type=bind,target=/root/.conan/data/vtd,source=/vtd,from=vtd,rw \
76
69
if [ -r /root/setup.sh ]; then . /root/setup.sh; fi && \
77
- make -f Makefile.all WITH_VTD=${WITH_VTD} ${VENDOR_TARGET} && \
70
+ make -f Makefile.all ${VENDOR_TARGET} && \
78
71
# Clean up:
79
72
conan user --clean && \
80
73
if [ ${KEEP_SOURCES} -eq 0 ]; then \
@@ -92,7 +85,7 @@ RUN --mount=type=cache,target=/ccache \
92
85
--mount=type=secret,target=/root/setup.sh,id=setup,mode=0400 \
93
86
if [ -r /root/setup.sh ]; then . /root/setup.sh; fi && \
94
87
echo "${PROJECT_VERSION}" > /cloe/VERSION && \
95
- make WITH_VTD=${WITH_VTD} ${PACKAGE_TARGET} && \
88
+ make ${PACKAGE_TARGET} && \
96
89
# Clean up:
97
90
conan user --clean && \
98
91
if [ ${KEEP_SOURCES} -eq 0 ]; then \
@@ -104,7 +97,6 @@ RUN --mount=type=cache,target=/ccache \
104
97
105
98
# Run smoketests.
106
99
RUN --mount=type=secret,target=/root/setup.sh,id=setup,mode=0400 \
107
- --mount=type=bind,target=/root/.conan/data/vtd,source=/vtd,from=vtd,rw \
108
100
if [ -r /root/setup.sh ]; then . /root/setup.sh; fi && \
109
- make WITH_VTD=${WITH_VTD} smoketest && \
101
+ make smoketest && \
110
102
conan user --clean
0 commit comments