Skip to content

Commit ae81370

Browse files
committed
add
1 parent ace1a65 commit ae81370

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ These are some sample docker containers for learning purposes.
2020
* [docker-exe](docker-exe): A [project](https://hub.docker.com/r/oneoffcoder/docker-exe) showing how to build a container that may be used as an executable.
2121
* [spark-jupyter](spark-jupyter): A [project](https://hub.docker.com/r/oneoffcoder/spark-jupyter) with Hadoop, Spark and Python that may be used to learn massively parallel processing.
2222
* [java-jupyter](java-jupyter): A [project](https://hub.docker.com/r/oneoffcoder/java-jupyter) to learn Java 12.
23+
* [cpp-cicd](cpp-cicd): A [C++](https://hub.docker.com/r/oneoffcoder/cpp-cicd) Docker image for building C++ projects using CMake and BOOST.
2324

2425
## Raspberry Pi Docker Images
2526

cpp-cicd/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ubuntu:19.10
2+
3+
LABEL org="One-Off Coder"
4+
LABEL email="[email protected]"
5+
6+
RUN apt-get update -y \
7+
&& apt-get upgrade -y \
8+
&& apt-get -y install build-essential cmake libboost-all-dev
9+
10+
RUN mkdir /project
11+
WORKDIR /project
12+
VOLUME [ "/project" ]
13+
14+
COPY scripts/build-project.sh /build/build-project.sh
15+
RUN chmod +x /build/build-project.sh
16+
17+
RUN apt-get clean \
18+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
19+
20+
CMD [ "/build/build-project.sh" ]

cpp-cicd/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
![One-Off Coder Logo](../logo.png "One-Off Coder")
2+
3+
# Purpose
4+
5+
A Continuous Integration/Continuous Delivery (CICD) Docker container for C++ projects using CMake and BOOST.
6+
7+
# Docker Hub
8+
9+
[Image](https://hub.docker.com/r/oneoffcoder/cpp-cicd)
10+
11+
# Citation
12+
13+
```
14+
@misc{oneoffcoder_cpp_cicd_2020,
15+
title={Docker container for C++ CI/CD},
16+
url={https://github.com/oneoffcoder/docker-containers/tree/master/cpp-cicd},
17+
journal={GitHub},
18+
author={One-Off Coder},
19+
year={2020},
20+
month={Feb}}
21+
```

cpp-cicd/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker build --no-cache -t cpp-cicd:local .

cpp-cicd/deploy.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
ORGANIZATION=oneoffcoder
4+
REPOSITORY=cpp-cicd
5+
VERSION=0.0.1
6+
IMAGEID=cpp-cicd:local
7+
8+
docker tag ${IMAGEID} ${ORGANIZATION}/${REPOSITORY}:${VERSION}
9+
docker tag ${IMAGEID} ${ORGANIZATION}/${REPOSITORY}:latest
10+
11+
docker push ${ORGANIZATION}/${REPOSITORY}:${VERSION}
12+
docker push ${ORGANIZATION}/${REPOSITORY}:latest

cpp-cicd/scripts/build-project.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
[ -d "/project/cmake-build-debug" ] && rm -fr /project/cmake-build-debug
3+
[ ! -d "/project/cmake-build-debug" ] && mkdir /project/cmake-build-debug
4+
cd /project/cmake-build-debug
5+
cmake ..
6+
make clean
7+
make
8+
make test

0 commit comments

Comments
 (0)