Skip to content

f0i/container

Repository files navigation

Dev Container

Something similar to Development Containers build with docker-compose and a few simple bash scripts.

Install

Requires docker, docker-compose and some basic tools like git, bash and ssh.

The commands bin/dev should be somewhere in your PATH.

  1. Assuming a project called allkinds in ~/projects/allkinds
  2. Clone this repo into the project root dev allkinds init
  3. Modify the Dockerfile to include the services and tools you need
  4. Build the docker container using the command dev build
  5. Start the docker container with dev start
  6. Connect to the container with dev and start development
  7. Enable port forwarding to the host dev ports 3000 8080:80, in this case port 3000 and 8080 of the host will be forwarded to port 3000 and 80 of the container

Comparision to Development Containers

  • Less dependencies: Only docker, docker-compose, git, bash and ssh
  • Easier to understand what is going on:
    • Main script is bin/dev: ~160 lines of bash, mostly if/else and case statements, no loops
    • Port forwarding in bin/ports: ~30 lines of bash, starting a ssh tunnel with ssh -L ...
    • Docker-compose file: ~20 lines of yaml, defining services and volumes
    • Dockerfile: ~10 lines, defining the base image and define which tools to install by default
    • Setup scripts called from Dockerfile or run manually in setup/: ~5-30 lines of bash each

You are supsed to modify the Dockerfile and setup scripts to fit your needs.

License

All code is licensed under the LetMeKnow license.

This software is provided "as is", without any warranty. You are free to use, modify and distribute it under the following terms:

After you have done that, you are free to use the code in any way you like. You can even remove the license notice if you want to.

About

Development container (not dev container)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published