added bind-mount upload file folder to containers of myems-api and admin
parent
d0e06e122e
commit
abadf16516
|
@ -30,14 +30,21 @@ cd myems/admin
|
||||||
docker build -t myems/myems-admin .
|
docker build -t myems/myems-admin .
|
||||||
```
|
```
|
||||||
* Run a Docker container
|
* Run a Docker container
|
||||||
|
If run on Windows host, bind-mount a share upload file folder at c:\upload to the container
|
||||||
```bash
|
```bash
|
||||||
docker run -d -p 8001:8001 --restart always --name myems-admin myems/myems-admin
|
docker run -d -p 8001:8001 -v c:\upload:/var/www/html/admin/upload --restart always --name myems-admin myems/myems-admin
|
||||||
|
```
|
||||||
|
If run on Linux host, bind-mount a share upload file folder at /upload to the container
|
||||||
|
```bash
|
||||||
|
docker run -d -p 8001:8001 -v /upload:/var/www/html/admin/upload --restart always --name myems-admin myems/myems-admin
|
||||||
```
|
```
|
||||||
|
|
||||||
-d Run container in background and print container ID
|
-d Run container in background and print container ID
|
||||||
|
|
||||||
-p Publish a container's port(s) to the host, 8001:8001 (Host:Container) binds port 8001 (right) of the container to TCP port 8001 (left) of the host machine.
|
-p Publish a container's port(s) to the host, 8001:8001 (Host:Container) binds port 8001 (right) of the container to TCP port 8001 (left) of the host machine.
|
||||||
|
|
||||||
|
-v If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.
|
||||||
|
|
||||||
--restart Restart policy to apply when a container exits
|
--restart Restart policy to apply when a container exits
|
||||||
|
|
||||||
--name Assign a name to the container
|
--name Assign a name to the container
|
||||||
|
|
|
@ -56,14 +56,21 @@ cp example.env .env
|
||||||
docker build -t myems/myems-api .
|
docker build -t myems/myems-api .
|
||||||
```
|
```
|
||||||
* Run a Docker container
|
* Run a Docker container
|
||||||
|
If run on Windows host, bind-mount a share upload file folder at c:\upload to the container
|
||||||
```bash
|
```bash
|
||||||
docker run -d -p 8000:8000 --restart always --name myems-api myems/myems-api
|
docker run -d -p 8000:8000 -v c:\upload:/var/www/html/admin/upload --restart always --name myems-api myems/myems-api
|
||||||
|
```
|
||||||
|
If run on Linux host, bind-mount a share upload file folder at /upload to the container
|
||||||
|
```bash
|
||||||
|
docker run -d -p 8000:8000 -v /upload:/var/www/html/admin/upload --restart always --name myems-api myems/myems-api
|
||||||
```
|
```
|
||||||
|
|
||||||
-d Run container in background and print container ID
|
-d Run container in background and print container ID
|
||||||
|
|
||||||
-p Publish a container's port(s) to the host, 8000:8000 (Host:Container) binds port 8000 (right) of the container to TCP port 8000 (left) of the host machine.
|
-p Publish a container's port(s) to the host, 8000:8000 (Host:Container) binds port 8000 (right) of the container to TCP port 8000 (left) of the host machine.
|
||||||
|
|
||||||
|
-v If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.
|
||||||
|
|
||||||
--restart Restart policy to apply when a container exits
|
--restart Restart policy to apply when a container exits
|
||||||
|
|
||||||
--name Assign a name to the container
|
--name Assign a name to the container
|
||||||
|
|
Loading…
Reference in New Issue