forked from ChicoState/MyFave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
64 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM ubuntu:noble | ||
LABEL title="CPP Container" | ||
LABEL version=1.0 | ||
ENV GTEST_REPO=/googletest | ||
ENV GTEST_DIR=${GTEST_REPO}/googletest | ||
ENV WORKDIR=/usr/src | ||
WORKDIR /usr/src | ||
|
||
# Set Docker arguments | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
g++ \ | ||
cmake \ | ||
git-all \ | ||
dos2unix | ||
RUN apt-get clean | ||
|
||
# Setup GoogleTest | ||
RUN git clone --depth=1 https://github.com/google/googletest ${GTEST_REPO} | ||
RUN mkdir ${GTEST_REPO}/build && cd ${GTEST_REPO}/build \ | ||
&& cmake .. -DBUILD_GMOCK=OFF && make && cd ${WORKDIR} | ||
|
||
# Copy repo source into container | ||
COPY . ${WORKDIR} | ||
|
||
# Assure Unix linefeed for all files | ||
RUN find . -type f -print0 | xargs -0 dos2unix -- | ||
|
||
# Build project | ||
CMD sh -c ${WORKDIR}/test_runner.sh |
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 +1,30 @@ | ||
# MyFave | ||
# MyFave | ||
|
||
This is a simple C++ command line application to maintain a list of your favorites. | ||
|
||
## Getting Started | ||
|
||
If you have not already built the image from `Dockerfile`, use the command: | ||
|
||
``` | ||
docker build -t cpp-container . | ||
``` | ||
|
||
You should only have to build once. Once built, run the container: | ||
|
||
``` | ||
docker run -it cpp-container | ||
``` | ||
|
||
...or run it interactively in a shell: | ||
|
||
``` | ||
docker run -it cpp-container sh | ||
``` | ||
|
||
...or run it with a volume mounted to the current source code: | ||
|
||
``` | ||
docker run -v "$(pwd)":/usr/src -it cpp-container | ||
``` | ||
|