Skip to content

markhedleyjones/docker-bbq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-bbq
docker-bbq

A tool for rapidly cooking up new Docker or Podman projects while simplifying containerised software development. Free yourself from writing and optimising dockerfiles and focus on development.

This tool might be useful if you:

  1. become frustrated from manually running docker run -it -v ... or podman run -it -v ..., or
  2. work across many container-based repositories and want more consistency, or
  3. are rebuilding your images after modifying source-code.

Demonstration

docker-bbq demonstration

Features

  • Executing containerised code becomes frictionless with the run command.
  • Create new repositories with create-repo. They're instantly buildable and have a consistent layout.
  • Workspace linking during development means changes to source-code appear instantly inside containers.
  • Building your image is as simple running make from within your workspace.
  • Create dependency lists and they'll be installed automatically at build-time:
    • System packages - build/packagelist
    • Python-pip packages - build/pip-requirements.txt (specify pip version e.g. pip3-requirements.txt)
    • Downloadable resources - build/urilist
  • When it's time to deploy, running make production builds the final stand-alone, distributable image.

Podman Support

docker-bbq is fully compatible with Podman, a container engine that is compatible with the Docker API. The tools automatically detect whether Docker or Podman is available on your system and use whichever is installed.

Using Podman on Fedora

On Fedora, you can install Podman with:

sudo dnf install podman

Once installed, you can use docker-bbq with Podman exactly as you would with Docker - no changes needed to your scripts or commands. The detection is automatic:

  • If both Docker and Podman are installed, Podman is preferred
  • The run command, bbq-create, and all test scripts work seamlessly with Podman

Overview

There are two components to docker-bbq. The first is create-repo, which can be used to make templated docker-bbq repositories. The second is the run command, which makes interacting and developing your Docker project quick and easy.

The 'run' command:

The run command lets you seamlessly execute things in your repository's workspace seamlessly. As an example, when running something like run ~/my-bbq-repo/workspace/hello_world.py, run does the following:

  1. Determines the required image based on the command or your location (the repo and image names always match, so in this case it's my-bbq-repo:latest).
  2. Checks if the required container is already running. If yes, the command will be executed inside it. If not, a new one will be created.
  3. Checks if the repository is in the "development state". If yes, the repository's workspace will be mounted into the new container.
  4. Detects the host system's display capabilities and configures the container accordingly.
  5. Launches a new container, or enters the existing one, and executes hello_world.py.
  6. After the container exits, ownership of files created in the container will be changed to your username.

Repository structure:

The basic structure of a docker-bbq repository is as follows (although depends on the template you select)

<project-name>
│
├─► build
│   │
│   ├─ packagelist                # List of system packages to install
│   │
│   └─ <build-related-files>      # For example, pip-requirements.txt
│
├─► workspace
│   │
│   └─ <your-project>             # Everything related to your project
│
├─ Dockerfile
│
├─ Makefile                       # Make-based build helper
│
└─ README.md                      # Pre-populated with build instructions

The repository includes a make-based Makefile to simplify the build process. There are two options for building your project:

  1. make - Builds the development image. Allows for faster development as the image's workspace is the repository's workspace.
  2. make production - Builds the production image. Ready to be shipped, the image contains its own workspace.

docker-bbq logo made with vector graphics from svgrepo.com (creative-commons license), with modifications.

About

A templated workflow to help develop software designed to run inside Docker containers.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •