User Tools

Site Tools


cloud:recipe:docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cloud:recipe:docker [2020/05/12 11:32] – created chudlercloud:recipe:docker [2020/11/18 16:28] (current) – [Modifying and Saving a Container] chudler
Line 2: Line 2:
 === INTRODUCTION === === INTRODUCTION ===
  
-This page provides examples to get started using the Openstack Container service known as [[ https://docs.openstack.org/zun/latest/ | Zun ]]. Also see zun topics+This page provides examples to get started using the Openstack Container service known as [[ https://docs.openstack.org/zun/latest/ | Zun ]].
  
  
Line 10: Line 10:
  
 ======Running a Public Container====== ======Running a Public Container======
-To run a container is as simple as  +To run a container, first launch it on a specific *internal* network. See [[https://howto.cs.uchicago.edu/cloud:cli#networks|Networks]] section of the CLI guide for more information about networks. You can use the general purpose __cloud__ network: 
-<code>openstack appcontainer run --net network=campus37 --wait nginx</code>+<code>openstack appcontainer run --net network=cloud --wait nginx</code> 
 + 
 +The container will be assigned a //name// and an internal IP on the __cloud__ network. To access the container from the outside world, first obtain a Floating IP address and then assign it to the container: 
 + 
 +<code> 
 +openstack floating ip create --subnet public37 campus37 
 +openstack appcontainer add floating ip lambda-15-container 128.135.xx.xx # use the IP address result from the previous command. 
 +</code> 
 + 
 +Now you can access the public IP address of the container for the default Nginx start page.
  
 Try these commands to get started (using the UUID of your running container instances): Try these commands to get started (using the UUID of your running container instances):
Line 33: Line 42:
 </code> </code>
  
-Glance has no user authentication, but will prevent access to your image from outside your project. To use a private docker registry instead of glance, first create a registry row in Zun.+Glance has no user authentication, but will prevent access to your image from outside your project. To use a private docker registry instead of glance, first create a registry row in Zun. The following example is part of a CI pipeline based on Git, Docker, Gitlab, and Openstack.
  
 <code> <code>
Line 49: Line 58:
 **Importantly**, the repository that you push the image to must have been setup in zun. See the previous section. **Importantly**, the repository that you push the image to must have been setup in zun. See the previous section.
 <code> <code>
-openstack appcontainer run --net network=campus37 --wait nginx +openstack appcontainer run --net network=cloud--wait nginx 
-sed -i -s 's/Welcome to nginx/Hello world/' /usr/share/nginx/html/index.html  +openstack appcontainer exec --interactive ${UUID} sed -i -s 's/Welcome to nginx/Hello world/' /usr/share/nginx/html/index.html  
-openstack appcontainer commit 55d162a6-f4f2-4881-a294-3022eb4cbbaf VCS_LDAPSLAVE:os_latest+openstack appcontainer commit ${UUID} VCS_LDAPSLAVE:os_latest
 </code> </code>
  
 ====Caveats===== ====Caveats=====
-Private registries are not supported for the ''openstack appcontainer image pull'', and related commands. Nonetheless, the images are automatically pulled to the compute host, or can be specified by+Private registries are not supported for the ''openstack appcontainer image pull'', and related commands. Nonetheless, the images are automatically pulled to the compute host, or can be customized with
 <code> <code>
 openstack appcontainer create --image-pull-policy ... openstack appcontainer create --image-pull-policy ...
/var/lib/dokuwiki/data/attic/cloud/recipe/docker.1589301170.txt.gz · Last modified: 2020/05/12 11:32 by chudler

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki