User Tools

Site Tools


cloud:recipe:docker

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
cloud:recipe:docker [2020/05/14 14:48] – [Private Registry Images] chudlercloud:recipe:docker [2020/11/18 16:26] – [Running a Public Container] chudler
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>
  
-Access the public IP address of the container for the default Nginx start page.+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 35: 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. The following example is part of a CI infrastructure based on Git, Docker, Gitlab, and Openstack.+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 52: Line 59:
 <code> <code>
 openstack appcontainer run --net network=campus37 --wait nginx openstack appcontainer run --net network=campus37 --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 ${UUID} 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/pages/cloud/recipe/docker.txt · Last modified: 2020/11/18 16:28 by chudler

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki