/containermaker

Configure, build, run, control docker containers with gnu-make and simple config files.

Primary LanguageMakefile

containermaker

Configure, build, run, control docker containers with gnu-make and simple config files.

This evolved from a small hack because i'm a lacy typing person so do not expect to much and use on your own risk :).

  • Howto use
# clone repository to your filesystem
git clone https://github.com/schmotzle/containermaker

# create a folder for your dockerfile and config files
mkdir hello-world-container
cd hello-world-container

# link the containermaker Makefile to your directory
ln -s ../containermaker/Makefile .

# run make to get a template Dockerfile and config file
make

# edit dockerfile and config file to fit your needs

# build the docker image by running
make build

# run docker container by executing
make run

# get a bash shell inside the container by executing
make interactive
  • Supported commands
# create a container image from Dockerfile
make build       

# save the container image into a tar file for deployment
make save

# load a container image from a tar file
make load        

# remove a saves container image tar file
make clean       

# run a shell inside the container for debugging
make interactive 

# run the container image
make run         

# run the container image in background
make background  

# stops the container image
make stop        

# attach to a container running in background mode
make attach      

# show logs from container running in background mode
make logs        
  • Extra sugar

The Makefile checks for certain executable files that are executed before and after "make run" and "make build". One can use these files to setup or clenup stuff after building or running the container. The files must be named "prerun", "postrun", "prebuild" or "postbuild".