-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from naviqore/feature/NAV-158-create-docker-st…
…ages-build-and-run-ctest Feature/nav 158 create docker stages build and run ctest
- Loading branch information
Showing
4 changed files
with
19 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,5 @@ | |
/vcpkg_installed | ||
/build | ||
/Folder.DotSettings.user | ||
/packages/* | ||
/vcpkg_installed/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
FROM gcc:latest | ||
# Stage 1: Build environment | ||
FROM gcc:latest AS build | ||
|
||
RUN apt-get update && apt-get install -y cmake git curl zip unzip tar | ||
|
||
# vcpkg to install dependencies | ||
RUN git clone https://github.com/microsoft/vcpkg.git /usr/src/vcpkg | ||
WORKDIR /usr/src/vcpkg | ||
RUN ./bootstrap-vcpkg.sh | ||
|
||
COPY . /usr/src/myapp/ | ||
COPY vcpkg.json /usr/src/myapp | ||
WORKDIR /usr/src/myapp | ||
COPY . /usr/src/raptorxx/ | ||
COPY vcpkg.json /usr/src/raptorxx | ||
|
||
WORKDIR /usr/src/raptorxx | ||
RUN /usr/src/vcpkg/vcpkg install --triplet x64-linux | ||
|
||
# Configure and build the project | ||
RUN cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/src/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
RUN cmake --build build | ||
|
||
RUN echo "RUNNING TESTS" | ||
# CMD ["/bin/bash"] | ||
|
||
RUN ctest --test-dir build --output-on-failure | ||
# Stage 2: Test execution environment | ||
FROM build AS runtime | ||
|
||
WORKDIR /usr/src/raptorxx | ||
|
||
COPY --from=build /usr/src/raptorxx/output/bin/release /usr/src/raptorxx/build | ||
CMD for test_exe in /usr/src/raptorxx/build/*_tests; do echo "Running $test_exe"; "$test_exe"; done | ||
|
||
# $ docker build -t my-gcc-linux-app . | ||
# $ docker run -it --rm --name my-running-app my-gcc-linux-app |