mirror of https://github.com/docker/docs.git
DD 4.15: Dev Envs content (#16180)
* DD 4.15: Dev Envs content * step fix * last edits * Update desktop/dev-environments/create-dev-env.md Co-authored-by: Han Yu <han@sent.com> * Update desktop/dev-environments/create-dev-env.md Co-authored-by: Han Yu <han@sent.com> * Update desktop/dev-environments/create-dev-env.md Co-authored-by: Han Yu <han@sent.com> * Update desktop/dev-environments/create-dev-env.md * Update desktop/dev-environments/create-dev-env.md Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> Co-authored-by: Han Yu <han@sent.com> Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
3fcd3c338f
commit
477d7f673b
|
@ -14,6 +14,11 @@ You can launch a dev environment from a:
|
|||
|
||||
This does not conflict with any of the local files or local tooling set up on your host.
|
||||
|
||||
>Tip
|
||||
>
|
||||
>Install the [Dev Environments browser extension](https://github.com/docker/dev-envs-extension){:target="_blank" rel="noopener" class="_"} for [Chrome](https://chrome.google.com/webstore/detail/docker-dev-environments/gnagpachnalcofcblcgdbofnfakdbeka){:target="_blank" rel="noopener" class="_"} or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/docker-dev-environments/){:target="_blank" rel="noopener" class="_"}, to launch a dev environment faster.
|
||||
{: .tip }
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Dev Environments is available as part of Docker Desktop 3.5.0 release. Download and install **Docker Desktop 3.5.0** or higher:
|
||||
|
@ -30,7 +35,7 @@ To get started with Dev Environments, you must also install the following tools
|
|||
>
|
||||
> After Git is installed, restart Docker Desktop. Select **Quit Docker Desktop**, and then start it again.
|
||||
|
||||
## Launch a dev environment from a Git repository or subdirectory.
|
||||
## Launch a dev environment from a Git repository
|
||||
|
||||
> **Note**
|
||||
>
|
||||
|
@ -71,15 +76,16 @@ fi
|
|||
|
||||
To launch a dev environment:
|
||||
|
||||
1. From **Under Dev Environments** in Docker Dashboard, select **Create**. The **Create a Dev Environment** dialog displays.
|
||||
2. Select **Get Started** and then copy your Git repository link and add it to the **Enter the Git Repository** field with **Existing Git repo** as the source.
|
||||
3. Select **Continue**.
|
||||
1. From **Dev Environments** in Docker Dashboard, select **Create**. The **Create a Dev Environment** dialog displays.
|
||||
2. Select **Get Started**.
|
||||
3. Optional: Provide a name for you dev environment.
|
||||
4. Select **Existing Git repo** as the source and then paste your Git repository link into the field provided.
|
||||
5. Choose your IDE. You can choose either:
|
||||
- **Visual Studio Code**. The Git repository is cloned into a Volume and attaches to your containers. This allows you to develop directly inside of them using Visual Studio Code.
|
||||
- **Other**. The Git repository is cloned into your chosen local directory and attaches to your containers as a bind mount. This shares the directory from your computer to the container, and allows you to develop using any local editor or IDE.
|
||||
6. Select **Continue**.
|
||||
|
||||
This detects the main language of your repository, clones the Git code inside a volume, determines the best image for your dev environment, and opens VS Code inside the dev environment container.
|
||||
|
||||
4. Hover over the container and select **Open in VS Code** to start working. You can also open a terminal in VS Code, and use Git to push or pull code to your repository, or switch between branches and work as you would normally.
|
||||
|
||||
5. To launch the application, run the command `make run` in your terminal. This opens an http server on port 8080. Open [http://localhost:8080](http://localhost:8080) in your browser to see the running application.
|
||||
To launch the application, run the command `make run` in your terminal. This opens an http server on port 8080. Open [http://localhost:8080](http://localhost:8080) in your browser to see the running application.
|
||||
|
||||
|
||||
## Launch from a specific branch or tag
|
||||
|
@ -101,23 +107,25 @@ Docker then clones the repository with your specified branch or tag.
|
|||
>Currently, Dev Environments is not able to detect the main language of the subdirectory. You need to define your own base image or services in a `compose-dev.yaml`file located in your subdirectory. For more information on how to configure, see the [React application with a Spring backend and a MySQL database sample](https://github.com/docker/awesome-compose/tree/master/react-java-mysql){:target="_blank" rel="noopener" class="_"} or the [Go server with an Nginx proxy and a Postgres database sample](https://github.com/docker/awesome-compose/tree/master/nginx-golang-postgres){:target="_blank" rel="noopener" class="_"}.
|
||||
|
||||
1. From **Dev Environments** in Docker Dashboard, select **Create**. The **Create a Dev Environment** dialog displays.
|
||||
2. Select **Get Started** and then copy your Git subfolder link into the **Enter the Git Repository** field with **Existing Git repo** as the source.
|
||||
3. Select **Continue**.
|
||||
2. Select **Get Started**.
|
||||
3. Optional: Provide a name for you dev environment.
|
||||
4. Select **Existing Git repo** as the source and then paste the link of your Git repo subfolder into the field provided.
|
||||
5. Choose your IDE. You can choose either:
|
||||
- **Visual Studio Code**. The Git repository is cloned into a Volume and attaches to your containers. This allows you to develop directly inside of them using Visual Studio Code.
|
||||
- **Other**. The Git repository is cloned into your chosen local directory and attaches to your containers as a bind mount. This shares the directory from your computer to the container, and allows you to develop using any local editor or IDE.
|
||||
6. Select **Continue**.
|
||||
|
||||
This clones the Git code inside a volume, determines the best image for your dev environment, and opens VS Code inside the dev environment container.
|
||||
|
||||
4. Hover over the container and select **Open in VS Code** to start working. You can also open a terminal in VS Code, and use Git to push or pull code to your repository, or switch between branches and work as you would normally.
|
||||
|
||||
5. To launch the application, run the command `make run` in your terminal. This opens an http server on port 8080. Open [http://localhost:8080](http://localhost:8080) in your browser to see the running application.
|
||||
To launch the application, run the command `make run` in your terminal. This opens an http server on port 8080. Open [http://localhost:8080](http://localhost:8080) in your browser to see the running application.
|
||||
|
||||
## Launch from a local folder
|
||||
|
||||
1. From **Dev Environments** in Docker Dashboard, select **Create**. The **Create a Dev Environment** dialog displays.
|
||||
2. Select **Get Started** and then choose **Local Folder** as the source.
|
||||
3. Next to **Select your local directory** field, select **Select** to open the root of the code that you would like to work on.
|
||||
4. Select **Continue**.
|
||||
|
||||
This detects the main language of your local folder, creates a dev environment using your local folder, and bind-mounts your local code in the dev environment. It then opens VS Code inside the dev environment container.
|
||||
2. Select **Get Started**.
|
||||
3. Optional: Provide a name for your dev environment.
|
||||
4. Choose **Local directory** as the source.
|
||||
5. Select **Select** to open the root directory of the code that you would like to work on.
|
||||
|
||||
A directory from your computer is bind mounted to the container, so any changes you make locally is reflected in the dev environment. You can use an editor or IDE of your choice.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue