You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
627 B
23 lines
627 B
# on host, create a container with a named container in /mydata
|
|
```docker run --rm -it -v myvolume:/mydata debian```
|
|
|
|
# in container, change directory to volume
|
|
```cd /mydata```
|
|
|
|
# create the greeting
|
|
```echo "hi from $(hostname)" > greetings.txt```
|
|
# show created file
|
|
```ls -l```
|
|
# output content of created file to console
|
|
```cat greetings.txt```
|
|
# exit from container
|
|
```exit```
|
|
|
|
|
|
# again on host, create another container with a named container in /stillmydata
|
|
```docker run --rm -it -v myvolume:/stillmydata debian```
|
|
# show greetings-file in volume
|
|
```cat /stillmydata/greetings.txt```
|
|
# exit from container
|
|
```exit```
|
|
|
|
|