docs icon indicating copy to clipboard operation
docs copied to clipboard

Guide issue: Docker Desktop can not finish!

Open JaxVN opened this issue 1 year ago • 0 comments

Is this a docs issue?

  • [X] My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

Run your app in a development container

The following steps describe how to run a development container with a bind mount that does the following:

Mount your source code into the container
Install all dependencies
Start nodemon to watch for filesystem changes

You can use the CLI or Docker Desktop to run your container with a bind mount. at Tab Docker Desktop can not see the Logs Make sure you don't have any getting-started containers currently running.

Run the image with a bind mount.

Select the search box at the top of Docker Desktop.

In the search window, select the Images tab.

In the search box, specify the container name, getting-started.

    Tip

    Use the search filter to filter images and only show Local images.

Select your image and then select Run.

Select Optional settings.

In Host path, specify the path to the getting-started-app directory on your host machine.

In Container path, specify /app.

Select Run.

You can watch the container logs using Docker Desktop.

Select Containers in Docker Desktop.
Select your container name.

You'll know you're ready to go when you see this:

nodemon -L src/index.js
[nodemon] 2.0.20
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node src/index.js`
Using sqlite database at /etc/todos/todo.db
Listening on port 3000

at tab PowerShell CLI: i can done and see the logs!

Location

https://docs.docker.com/get-started/06_bind_mounts/

Suggestion

Docker Desktop version: 4.29.0 (145265), and the GUI i can not see the where i can do as PowerShell CLI

docker run -dp 127.0.0.1:3000:3000 `
    -w /app --mount "type=bind,src=$pwd,target=/app" `
    node:18-alpine `
    sh -c "yarn install && yarn run dev"

image

May be you need take a look and check it out!

JaxVN avatar May 14 '24 06:05 JaxVN