Skip to content

Simple CMake project to demonstrate persistant data with Docker.

Notifications You must be signed in to change notification settings

piotte13/cpp_docker_persistance_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ehh.. What is that?

This is a simple c++ program that will output some text file to the folder ./artifacts from a docker container. The motivation is to demonstrate a simple solution to persistant data when developping using Docker.

Usage

First, build an image from the Dockerfile in the current directory and tag the image. Note that the Dockerfile does not copy the source code, therefore you do not need to rebuild the image every time there's a change to the source code!

$ git clone https://github.com/piotte13/cpp_docker_persistance_example.git
$ cd cpp_docker_persistance_example

$ docker build -t docker_persistance_example .

Then, every time you want to run the program, run this command. The source code will be mounted to the docker container and the output files will directly be sent to the host system.

docker run --rm -it -v $(pwd):/project docker_persistance_example

About

Simple CMake project to demonstrate persistant data with Docker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published