Docker related changes.
This commit is contained in:
parent
29bc09d5fe
commit
ca820ff108
|
|
@ -1,23 +0,0 @@
|
|||
FROM alpine:3.21.3
|
||||
|
||||
# Install tools required for building.
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
autoconf \
|
||||
bash \
|
||||
build-base \
|
||||
cmake \
|
||||
clang \
|
||||
clang-extra-tools \
|
||||
gdb \
|
||||
git \
|
||||
libstdc++ \
|
||||
libtool \
|
||||
linux-headers \
|
||||
ninja \
|
||||
m4 \
|
||||
perl \
|
||||
python3 \
|
||||
py3-pip && \
|
||||
pip install --break-system-packages conan && \
|
||||
conan profile detect
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "C++",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
"dockerfile": "../devcontainer.Dockerfile"
|
||||
},
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
|
|
@ -9,11 +9,8 @@
|
|||
"settings": {
|
||||
"conan-extension.installArgs": [
|
||||
"-of build",
|
||||
"-b \"*\"",
|
||||
"-s build_type=Debug"
|
||||
],
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build",
|
||||
"cmake.installPrefix": "${workspaceFolder}/install"
|
||||
},
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
|
|
@ -23,4 +20,4 @@
|
|||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
|
|||
|
||||
class HelloConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
requires = "boost/1.89.0", "gtest/1.14.0", "libmagic/5.45", "freetype/2.13.3", "libjpeg/9f"
|
||||
requires = "boost/1.89.0", "gtest/1.14.0", "libmagic/5.45", "freetype/2.14.1", "libjpeg/9f"
|
||||
generators = "CMakeDeps"
|
||||
build_policy = "*"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
FROM alpine:3.21.3 AS build
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
libstdc++
|
||||
|
||||
# Install tools required for building.
|
||||
RUN apk add --no-cache \
|
||||
autoconf \
|
||||
bash \
|
||||
build-base \
|
||||
cmake \
|
||||
clang \
|
||||
clang-extra-tools \
|
||||
gdb \
|
||||
git \
|
||||
libtool \
|
||||
linux-headers \
|
||||
ninja \
|
||||
m4 \
|
||||
perl \
|
||||
python3 \
|
||||
py3-pip && \
|
||||
pip install --break-system-packages conan && \
|
||||
conan profile detect
|
||||
|
||||
# Pre-build some conan packages we require and take a lot of time to build. This to
|
||||
# avoid expensive rebuilding everytime we need a fresh dev container..
|
||||
RUN mkdir -p /workspaces/tmp
|
||||
WORKDIR /workspaces/tmp
|
||||
RUN conan install -s build_type=Debug -b=* --requires=boost/1.89.0
|
||||
RUN conan install -s build_type=Debug -b=* --requires=libmagic/5.45
|
||||
RUN conan install -s build_type=Debug -b=* --requires=freetype/2.14.1
|
||||
RUN conan install -s build_type=Debug -b=missing --requires=gtest/1.14.0
|
||||
RUN conan install -s build_type=Debug -b=missing --requires=libjpeg/9f
|
||||
|
||||
# Remove the temporary workspace, build results for the conan packages remain cached.
|
||||
WORKDIR /workspaces
|
||||
RUN rm -rf tmp && \
|
||||
mkdir network-experiment && \
|
||||
mkdir build && \
|
||||
mkdir install
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
FROM alpine:3.21.3 AS build
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
libstdc++
|
||||
|
||||
# Install tools required for building.
|
||||
RUN apk add --no-cache \
|
||||
autoconf \
|
||||
bash \
|
||||
build-base \
|
||||
cmake \
|
||||
clang \
|
||||
clang-extra-tools \
|
||||
gdb \
|
||||
git \
|
||||
libtool \
|
||||
linux-headers \
|
||||
ninja \
|
||||
m4 \
|
||||
perl \
|
||||
python3 \
|
||||
py3-pip && \
|
||||
pip install --break-system-packages conan && \
|
||||
conan profile detect
|
||||
|
||||
# Pre-build some conan packages we require and take a lot of time to build. This to
|
||||
# avoid expensive rebuilding everytime we need a fresh dev container..
|
||||
RUN mkdir -p /workspaces/tmp
|
||||
WORKDIR /workspaces/tmp
|
||||
RUN conan install -s build_type=Release -b=* --requires=boost/1.89.0
|
||||
RUN conan install -s build_type=Release -b=* --requires=libmagic/5.45
|
||||
RUN conan install -s build_type=Release -b=* --requires=freetype/2.14.1
|
||||
RUN conan install -s build_type=Release -b=missing --requires=gtest/1.14.0
|
||||
RUN conan install -s build_type=Release -b=missing --requires=libjpeg/9f
|
||||
|
||||
# Remove the temporary workspace, build results for the conan packages remain cached.
|
||||
WORKDIR /workspaces
|
||||
RUN rm -rf tmp && \
|
||||
mkdir network-experiment && \
|
||||
mkdir build && \
|
||||
mkdir install
|
||||
|
||||
|
||||
# Build and install
|
||||
WORKDIR /workspaces/network-experiment
|
||||
ADD . .
|
||||
RUN conan install /workspaces/network-experiment -of /workspaces/build -s build_type=Release
|
||||
RUN cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -S . -B /workspaces/build --install-prefix=/workspaces/install
|
||||
RUN cmake --build /workspaces/build --parallel
|
||||
RUN cmake --install /workspaces/build
|
||||
|
||||
|
||||
FROM alpine:3.21.3
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
libstdc++
|
||||
|
||||
RUN mkdir -p /workspaces/network-experiment/applications/http-mandelbrot/html
|
||||
|
||||
COPY --from=build /workspaces/install/bin/http-mandelbrot /bin
|
||||
COPY --from=build /workspaces/install/bin/magic.mgc /bin
|
||||
COPY --from=build /workspaces/network-experiment/applications/http-mandelbrot/html /workspaces/network-experiment/applications/http-mandelbrot/html
|
||||
|
||||
WORKDIR /bin
|
||||
ENTRYPOINT ["http-mandelbrot"]
|
||||
EXPOSE 9800/tcp
|
||||
|
||||
|
||||
Loading…
Reference in New Issue