Howto:Docker scenery toolchain: Difference between revisions

Jump to navigation Jump to search
→‎Docker scenery toolchain image: Simplified getting files into the container by mounting a directory.
No edit summary
(→‎Docker scenery toolchain image: Simplified getting files into the container by mounting a directory.)
Line 24: Line 24:


<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
docker run -i -t flightgear/terragear /bin/bash
docker run -i -t flightgear/terragear /bin/bash -v <host directory>:<docker directory>
</syntaxhighlight>
</syntaxhighlight>
&lt;host directory&gt; is the directory on your computer that's mounted into the container.<br>
&lt;docker directory&gt; is the directory where the computers directory is mounted in.


When you exit from the bash shell, the container will be stopped.  Use the following commands to list all the containers, start the container up, copy a file into it, and execute an interactive bash shell on it
When you exit from the bash shell, the container will be stopped.  Use the following commands to list all the containers, start the container up, and execute an interactive bash shell on it. To copy file into the docker container, just move them into the &lt;host directory&gt; from above and you'll find them in the &lt;docker directory&gt;.


<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
docker container ls -a    # List all containers, even those stopped
docker container ls -a    # List all containers, even those stopped
docker container start <container_name>  # Start and existing container
docker container start <container_name>  # Start and existing container
docker container cp <source_file> <container_name>:<destination> # Copy a file into the cotnainer
docker container exec -i -t <container_name> /bin/bash  # Run a bash shell, and connect to it.
docker container exec -i -t <container_name> /bin/bash  # Run a bash shell, and connect to it.
</syntaxhighlight>
</syntaxhighlight>


Now, when you exit, the container will continue running
Now, when you exit, the container will continue running
102

edits

Navigation menu