2,225
edits
No edit summary |
|||
Line 48: | Line 48: | ||
=== Create Containers === | === Create Containers === | ||
This is my go-to recipe for daily container creation: | This is my go-to recipe for daily container creation: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
# | # Basic container creation | ||
docker create -ti --name mycontainer ubuntu:18.04 | docker create -ti --name mycontainer ubuntu:18.04 | ||
# Share dir: /home/mgruner (host) in /host (container) | # Share dir: /home/mgruner (host) in /host (container) | ||
docker create -ti -v /home/mgruner/:/host ubuntu:18.04 | docker create -ti -v /home/mgruner/:/host ubuntu:18.04 | ||
Line 68: | Line 60: | ||
# Share file: /home/mgruner/file.txt (host) in /host.txt (container) | # Share file: /home/mgruner/file.txt (host) in /host.txt (container) | ||
docker create -ti -v /home/mgruner/file.txt:/host.txt ubuntu:18.04 | docker create -ti -v /home/mgruner/file.txt:/host.txt ubuntu:18.04 | ||
# Create a persistent volume for future use | |||
# Create a persistent volume | |||
docker create -ti -v myvolume:/host ubuntu:18.04 | docker create -ti -v myvolume:/host ubuntu:18.04 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:docker]][[Category:tutorial]] | [[Category:docker]][[Category:tutorial]] |