- Notifications
You must be signed in to change notification settings - Fork928
docs: add Docker quickstart#2875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 3 additions & 1 deletiondocker-compose.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionsdocs/ides/configuring-web-ides.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Binary file addeddocs/images/quickstart/docker/create-workspace.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addeddocs/images/quickstart/docker/ides.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addeddocs/images/quickstart/docker/login.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletionsdocs/install.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletiondocs/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
51 changes: 3 additions & 48 deletionsdocs/quickstart.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,6 @@ | ||
#Quickstart | ||
See our[Docker quickstart](./quickstart/docker.md) for the easiest | ||
possible way to use Coder. | ||
Otherwise, you can check out the[generic quickstart](./quickstart/generic.md). |
83 changes: 83 additions & 0 deletionsdocs/quickstart/docker.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#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 | ||
- A single MacOS or Linux box | ||
- A running Docker daemon | ||
##Instructions | ||
1.[Install and launch Coder](../install.md) | ||
You may use`CODER_ACCESS_URL=http://localhost:7080` since we're using local | ||
Docker workspaces exclusively. The rest of the guide will assume that this is your | ||
access URL. | ||
```bash | ||
coder server -a$CODER_ACCESS_URL | ||
``` | ||
1. Run`coder login http://localhost:7080`in a new terminal and follow the | ||
interactive instructions to create your user. | ||
1. Pull the example template: | ||
```bash | ||
echo"docker"| coder templates init | ||
cd docker | ||
# You should see a `main.tf` file in this directory | ||
``` | ||
1. Open up`main.tf`in your preferred editor to edit the images | ||
You can skip this stepif you're fine with our default, generic OS images. | ||
Search for the following section in `main.tf`: | ||
```hcl | ||
... | ||
variable "docker_image" { | ||
description = "Which Docker image would you like to use for your workspace?" | ||
# The codercom/enterprise-* images are only built for amd64 | ||
default = "codercom/enterprise-base:ubuntu" | ||
validation { | ||
condition = contains(["codercom/enterprise-base:ubuntu", "codercom/enterprise-node:ubuntu", | ||
"codercom/enterprise-intellij:ubuntu", "codercom/enterprise-golang:ubuntu"], var.docker_image) | ||
error_message = "Invalid Docker image!" | ||
} | ||
} | ||
... | ||
``` | ||
And edit the strings in `condition = contains([...])` and `default = ...` | ||
with your preferred images. | ||
1. Push up the template to Coder with `coder templates create` | ||
1. Open the dashboard in your browser (http://localhost:7080) to create your | ||
first workspace: | ||
<img src="./images/quickstart/docker/login.png"> | ||
Then navigate to `Templates > docker > Create workspace` | ||
<img src="./images/quickstart/docker/create-workspace.png"> | ||
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. | ||
1. All done! | ||
<img src="./images/quickstart/docker/ides.png"> | ||
Open up a web application or [SSH in](../ides.md#ssh-configuration). | ||
## Next Steps | ||
- [Learn more about template configuration](../templates.md) | ||
- [Configure more IDEs](../ides/configuring-web-ides.md) |
49 changes: 49 additions & 0 deletionsdocs/quickstart/generic.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## Prerequisites | ||
Please [install Coder](./install.md) before proceeding with the steps outlined in this article. | ||
## Creating your first template and workspace | ||
In a new terminal window, run the following to copy a sample template: | ||
```bash | ||
coder templates init | ||
``` | ||
Follow the CLI instructions to select an example that you can modify for your | ||
specific usage (e.g., a template to **Develop code-server in Docker**): | ||
1. Navigate into your new templates folder and create your first template using | ||
the provided command (e.g., `cd ./docker-code-server && coder templates create`) | ||
1. Answer the CLI prompts; when done, confirm that you want to create your template. | ||
Create a workspace using your template: | ||
```bash | ||
coder create --template="yourTemplate" <workspaceName> | ||
``` | ||
Connect to your workspace via SSH: | ||
```bash | ||
coder ssh <workspaceName> | ||
``` | ||
You can also access your workspace using the **access URL** you provided when | ||
deploying Coder (if you're using a temporary deployment and you opted to use | ||
Coder's tunnel, use the access URL you were provided). Log in with the admin | ||
credentials provided to you by Coder. | ||
 | ||
## Modifying templates | ||
You can edit the Terraform template as follows: | ||
```sh | ||
coder templates init | ||
cd gcp-linux # modify this line as needed to access the template | ||
vim main.tf | ||
coder templates update gcp-linux # updates the template | ||
``` |
30 changes: 25 additions & 5 deletionsexamples/templates/docker/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.