Files
coder/docs/quickstart/docker.md
T

78 lines
2.4 KiB
Markdown
Raw Normal View History

2022-07-11 12:05:05 -05:00
# 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
## Requirements
2022-08-11 20:22:06 -05:00
- A single macOS or Linux box
2022-07-11 12:05:05 -05:00
- A running Docker daemon
## Instructions
2022-09-08 15:41:00 -04:00
1. [Install and launch Coder](../install)
2022-07-11 12:05:05 -05:00
2022-10-07 08:05:56 -05:00
The Coder server binds to port 3000 by default. Use `--address :<port>` to customize it!
2022-07-11 12:05:05 -05:00
Use the [Coder tunnel](../admin/configure.md#tunnel) for a public URL:
2022-07-11 12:05:05 -05:00
```bash
coder server
2022-07-11 12:05:05 -05:00
```
Or set an [access URL](../admin/configure.md#access-url) to run entirely locally:
```bash
coder server --access-url=http://localhost:3000 --address=:3000
```
1. Run `coder login <access url>` in a new terminal and follow the
2022-07-11 12:05:05 -05:00
interactive instructions to create your user.
2022-09-29 17:55:15 -05:00
1. Pull the "Docker" example template using the interactive `coder templates init`:
2022-07-11 12:05:05 -05:00
```bash
coder templates init
cd docker
2022-07-11 12:05:05 -05:00
```
2022-09-29 17:55:15 -05:00
1. Push up the template with `coder templates create`
2022-10-07 08:05:56 -05:00
1. Open the dashboard in your browser (http://localhost:3000) to create your
2022-07-11 12:05:05 -05:00
first workspace:
2022-07-11 17:35:24 -05:00
<img src="../images/quickstart/docker/login.png">
2022-07-11 12:05:05 -05:00
Then navigate to `Templates > docker > Create workspace`
2022-07-11 17:35:24 -05:00
<img src="../images/quickstart/docker/create-workspace.png">
2022-07-11 12:05:05 -05:00
2022-09-29 17:55:15 -05:00
Now wait a few moments for the workspace to build... After the first build,
2022-07-11 12:05:05 -05:00
the image is cached and subsequent builds will take a few seconds.
2022-09-29 17:55:15 -05:00
1. Your workspace is ready to go!
2022-07-11 12:05:05 -05:00
2022-07-11 17:35:24 -05:00
<img src="../images/quickstart/docker/ides.png">
2022-07-11 12:05:05 -05:00
Open up a web application or [SSH in](../ides.md#ssh-configuration).
2022-09-29 17:55:15 -05:00
1. 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](../templates.md#creating-and-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](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
2022-07-11 12:05:05 -05:00
## Next Steps
2022-10-04 14:57:06 -05:00
- [Port-forward](../networking/port-forwarding.md)
2022-07-11 12:05:05 -05:00
- [Learn more about template configuration](../templates.md)
- [Configure more IDEs](../ides/web-ides.md)