Changes

Jump to navigation Jump to search
m
no edit summary
> docker kill example_1_application_1
</syntaxhighlight>
 
 
== Uploading the final container to the cluster registry ==
This should give you an idea of how powerful this framework is. The image is now ready to be deployed using Kubernetes.
 
 
 
== Remark: persistent storage in the container ==
 
After the container terminates, all data which was stored on its filesystem is lost. To write to persistent storage from inside the container which survives container destruction, you have to mount a host filesystem. This can be done in the docker-compose.yml like this (add to the "application" container section):
 
<syntaxhighlight lang="bash">
</syntaxhighlight>
 
Everything which is written inside the container to "application/output" will now end up the in the "output" directory on the host (paths are relative to the docker compose config). You can also mount read-only if you just want to import data from the host:
 
<syntaxhighlight lang="bash">
</syntaxhighlight>
 
Note that this mechanism is only for reference and your own testing, it will not work on the cluster. See the detailed tutorial on Persistent data on the cluster for how it works here.
 
 
== Remark: exposing container network ports on the host ==
 
One big use case of containers are web applications, i.e. the container acts as a webserver on some port. For example, the whole CCU web infrastructure lives inside several interconnected containers which expose ports on the main server. You can have for example a web server listening on port 80 inside the container, and map this port to an arbitrary port on your host, connect containers to each other, and so on. If you are interested, check out the excellent [https://docs.docker.com/get-started/part2/ docker tutorials available online, for example this one].
 
 
[[Category:Tutorials]]

Navigation menu