The word Dock written in white in the Milkshake font.


            The GitHub Octocat mark, which is a white circle with the
            silhouette of the Octocat cut out of it.
joe@/home/joe$ git clone https://github.com/joe/project.git
joe@/home/joe$ cd project
joe@/home/joe/project$ target/hello
   target/hello: No such file or directory
joe@/home/joe/project$ make
   make: command not found
joe@/home/joe/project$ dock
hostuser@/project$ make
    Building...
    Built 'target/hello'
hostuser@/project$ exit
joe@/home/joe/project$ target/hello
    Hello, world!
The Dock logo on a white background


              The phrase 'Getting Started', written in white in the Milkshake
              font.

  1. 1. dock init

    Adds dock.yaml and build.Dockerfile

    $ dock init rust
        Skipped './Cargo.toml'
        Skipped './src'
        Skipped './src/main.rs'
        Created './build.Dockerfile'
        Created './dock.yaml'
    
    
                  
  2. 2. dock shell -D

    Work from within your build enviroment

    $ dock shell -D
        [$] docker build ...
        [>] Sending build context to Docker daemon
        [>] ...
        [>] Successfully tagged org/proj.build:latest
        ...
        [$] docker run ...
    [>] I have no name!@host$ ls
        [>] build.Dockerfile Cargo.toml dock.yaml src
  3. 3. dock

    Don't output debugging information

    $ cargo run
       The program 'cargo' is currently not installed.
    $ dock
    I have no name!@host$ cargo run
           Compiling proj v0.0.1 (/app)
            Finished dev [unoptimized + debuginfo] target(s)
             Running `target/debug/proj`
        hello, world!
                  


              The phrase 'Installation', written in teal in the Milkshake font.


              The phrase 'Features', written in teal in the Milkshake font.


              The phrase 'Benefits', written in teal in the Milkshake font.


              The phrase 'Best Practices', written in teal in the Milkshake
              font.

When to use Dock

Dock is primarily intended to be used as part of your local development process. It should ideally be used in your team's centralised build pipeline too, to build artefacts and images for production use.

Note that Dock commands shouldn't be used to directly run production services (by using dock run-in prod-env: serve, for example). This is because the features that Dock provides are primarily for speeding up development, particularly through the use of bind mounts (volumes are generally more appropriate for production scenarios). Instead, a dedicated container orchestrator like Docker Compose should be used instead of Dock for running production workloads.


              The phrase 'Alternatives', written in teal in the Milkshake font.

dockerized

dockerized is a tool for seamlessly executing commands in a container.

Where Dock is a thin wrapper around the Docker CLI, dockerized is a thin wrapper around Docker Compose, which is used to achieve similar functionality. The goals and benefits of the two tools are largely the same, they mostly differ in terms of implementation. The dockerized documentation in particular provides a great outline of why you should keep your build dependencies in a Dockerfile, as well as a list of manual alternatives and their downsides.

The use of Docker Compose by dockerized allows orchestration of multiple services using the standard compose file. dockerized also has support for VSCode Remote Containers by default, and has a number of "starter kits" for popular languages, and VSCode. dockerized also provides a mechanism for pushing and pulling the build environment itself, to speed up the creation of build environments that involve steps with a large latency.

Dock provides a number of convenience features that aren't available in Docker Compose at present, including mounting the local user and group (so that commands aren't run as root), simplified mounting of the host Docker engine, nested bind mounts, and cache volumes (which are slightly different to the standard volumes that Docker provides). Dock also provides a dock rebuild subcommand, that can be used to keep your images up-to-date even when you're not using the dock run-in and dock shell subcommands, which can pair conveniently with the use of Docker Compose (and dockerized itself, for that matter).