Files
coder/docs/platforms/docker.md
Kyle Carberry 2a492b7008 chore: improve the setup experience with various fixes (#8130)
* Move updatecheck logs to debug mode

This was causing logs to be emitted immediately after
initial setup, which seemed odd for the user.

* Fix setup page text to say "Create" instead of "Setup" account

* Improve copy on the empty workspaces page

- This view can be seen after the user creates their first workspace, so saying first is bad.
- It should describe what a workspace is, so I modified the description.
- The create from template button wasn't helpful!

* Improve the copy for the empty templates view

- This didn't describe what a template actually is.
- The title had the same problem as workspaces, where first makes no sense.

* Improve text consistency on the Create Template page

* Fix "View activity" displaying for non-Enterprise users

This was causing an exception to be thrown.

* Improve messaging of empty groups view

* Appropriately capitalize Workspace and Template

* Improve Docker template taglines

* Fix types
2023-06-21 18:23:59 -05:00

2.8 KiB

Docker

Coder with Docker has the following advantages:

  • Simple installation (everything is on a single box)
  • Workspace images are easily configured
  • Workspaces share resources for burst operations

Note that the below steps are only supported on a Linux distribution. If on macOS, please run Coder via the standalone binary.

Requirements

  • A Linux machine
  • A running Docker daemon

Instructions

  1. Run Coder with Docker.

    export CODER_DATA=$HOME/.config/coderv2-docker
    export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
    mkdir -p $CODER_DATA
    docker run --rm -it \
        -v $CODER_DATA:/home/coder/.config \
        -v /var/run/docker.sock:/var/run/docker.sock \
        --group-add $DOCKER_GROUP \
        ghcr.io/coder/coder:latest
    

    This will use Coder's tunnel and built-in database. See our Docker documentation for other configuration options such as running on localhost, using docker-compose, and external PostgreSQL.

  2. In new terminal, install Coder in order to connect to your deployment through the CLI.

    curl -L https://coder.com/install.sh | sh
    
  3. Run coder login <access url> and follow the interactive instructions to create your user.

  4. Pull the "Docker" example template using the interactive coder templates init:

    coder templates init
    cd docker
    
  5. Push up the template with coder templates create

  6. Open the dashboard in your browser to create your first workspace:

    Then navigate to Templates > docker > Create Workspace

    Now wait a few moments for the workspace to build... After the first build, the image is cached and subsequent builds will take a few seconds.

  7. Your workspace is ready to go!

    Open up a web application or SSH in.

  8. If you want to modify the Docker image or template, edit the files in the previously created ./docker directory, then run coder templates push.

Troubleshooting

Docker-based workspace is stuck in "Connecting..."

Ensure you have an externally-reachable CODER_ACCESS_URL set. See troubleshooting templates for more steps.

Permission denied while trying to connect to the Docker daemon socket

See Docker's official documentation to Manage Docker as a non-root user.

Next Steps