Skip to content

Instantly share code, notes, and snippets.

@scollier
Last active August 29, 2015 14:04
Show Gist options
  • Save scollier/13436168f4539d6193dd to your computer and use it in GitHub Desktop.
Save scollier/13436168f4539d6193dd to your computer and use it in GitHub Desktop.
Atomic Demo
1. Cover Agenda - No slides, all demo
1. Demo 1: Setting up RHEL Atomic
a. Getting the qcow2 image from the customer portal
b. Adding more disk space, fdisk / mkfs.xfs, fstab
c. subscribe the host with subscription manager, list subs
d. finish up demo 1 with a "rpm-ostree upgrade" , reboot into a configured environment
2. Demo 2: Cover a basic httpd server Dockerfile - Non-Systemd
a. Build the image
b. run the image
c. Typical Docker commands: Docker {ps, images, log, etc..}
d. Show networking bridge, iptables
e. Enter the namespace of the RHEL platform base image and look around
f. test the image
3. Demo 3: Links
a. Build the image
b. run the image
c. test the image
4. Demo 4: Show how to enter a namespace
Demo 1 Steps:
1. Show the link for the qcow:
https://access.redhat.com/downloads/content/247/ver=/rhel---7/7/x86_64/product-downloads
Go ahead and download it. Don't have to wait for it to finish. go to ra-vms to finish. in /root/atomic
2. extract the qcow2 image and copy it over to /var/lib/libvirt
xz -d rhel-atomic-host-standard.qcow2.xz
cp rhel-atomic-host-standard.qcow2 /var/lib/libvirt/images/new-atomic.qcow2
3. Show the metadata / userdata, create iso. copy iso over.
cat user-data
cat meta-data
genisoimage -output atomic0-cidata.iso -volid cidata -joliet -rock user-data meta-data
cp atomic0-cidata.iso /var/lib/libvirt/images/
4. Create a new logical volume for /var/lib/docker
lvcreate -L 15G -n new-atomic VM_vg
5. Switch over and show how to install the VM
give name: new-atomic-scollier
import existing disk image
browse to new-atomic.qcow2
change memory and CPUs
Finish up and install the VM.
virt-install --import --name new-atomic --ram 4096 --vcpus 2 --disk path=/var/lib/libvirt/images/new-atomic.qcow2,format=qcow2,bus=virtio --disk path=/var/lib/libvirt/images/atomic0-cidata.iso,device=cdrom --disk path=/dev/VM_vg/new-atomic,bus=virtio --network bridge=rabr --graphics vnc --force
virt-viewer new-atomic
Username: cloud-user
Password: atomic
6. Get the IP address and SSH in. When you SSH in, not how it works with pubkey.
7. Configure the storage
sudo su -
fdisk -l
fdisk /dev/vdb
mkfs.xfs /dev/vdb1
blkid /dev/vdb1
edit /etc/fstab
UUID="d3e47b7d-7f8a-4e19-8c53-32c6199858b8" /var/lib/docker xfs defaults 1 1
8. Register with subscription manager
yum repolist
sudo subscription-manager register --username rhn-engineering-scollier
sudo subscription-manager attach --pool 8a85f9823e3d5e43013e3dce8ff306fd
sudo subscription-manager list --available
yum repolist
9. Update the system
sudo rpm-ostree upgrade
10. Reboot. After reboot show the storage on /var/lib/docker. Switch over to an Atomic host that already has images downloaded.
Demo 2 Steps:
1. systemctl status docker -l
rpm -qd docker
docker # to show options
man docker save
docker ps
docker images
2. Explore the httpd Dockerfile
/root/docker-image-examples/rhel-httpd
cat Dockerfile
Cover all the lines in it
Cover the script run-apache.sh
3. Build run the image
docker build -t test/apachenew .
docker images
docker run -t -d -p 80:80 test/apachenew
docker ps # show ports
docker top <uuid>
curl http://localhost
Demo 3 Steps:
1. Show how to use links
docker run -dt --name websvr apache/demo
docker run -it --link websvr:web --name test fedora:20 /bin/bash
env | grep -i web
ip a
curl http://<IP OF OTHER CONTAINER>
Exit the container
Demo 4 Steps:
1. Launch the fedora/redis image
docker run -dt fedora/redis
2. Show how to enter the namespace
docker inspect --format '{{ .State.Pid }}' 6a6
nsenter -m -u -n -i -p -t 20755 bash
ps aux
ip a
hostname
iptables
Talk about next tech talk.
Close out
Questions and Answers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment