If you’re familiar with Docker you’ll see that the commands and behaviour are identical. Hyper found that the jenkins image was not available locally, pulled it and then started the container.

A note on container sizes
The Hyper CLI actually hid one argument from you during the hyper run command that’s worth mentioning. With Hyper you can choose the size of your container using the --size flag. The default size for a container is ‘s4’ as you can see in the hyper run documentation. You can see what the various sizes mean on the pricing page here.

Next we exposed port 8080 via the -p 8080:8080 flag so that we can later attach our container to a public IP.

Lastly, we mounted a Hyper Volume at /var/jenkins_home which defaults to 10GB in size but can go up to 50GB. Hyper Volumes are analogous to Amazon EBS mounts in that they allow you to decouple the lifetime of your data from the lifetime of your container. You don’t need to worry about that now though, as we will cover volumes in more detail later on.

A note on volume types
You don’t have to use extra volumes with your containers like we did in the example above. All containers are created with a fixed 10GB root file system volume that persists for the lifetime of the container. Extra volumes do situations like container upgrades and disaster recovery much simpler though.

Exposing via a public IP

Now that the Jenkins container is running, we will connect it to a public IP address. First you need to create a new public IP address, which in Hyper is called a floating IP (FIP).

A note on FIP billing
Resources on Hyper are billed per-second, apart from FIPs which cost $1 per month from the point of allocation. This is to prevent abuse. To stop you accidentally spending too much money on FIPs you will be warned by the CLI if you attempt to allocate a new FIP when you have unused FIPs still available.

Inspecting the container

Before we look at Jenkins itself, let’s take a look at some of the ways you can inspect your container. If you type hyper ps you can now see that the jenkins container is running, and is exposing port 8080 via the FIP you allocated earlier.

hyper inspect shows you information about your container, most of which is outside the scope of this section. You can see the container size however, which is useful for in case you cannot remember which size you started your containers as.

You can now paste your initialAdminPassword into the browser in order to proceed. Configuring Jenkins is outside the scope of this guide, but you’ve now seen how to start a container, connect it to a public IP, inspect it and interact with it. Now we’ll clean everything up.

Cleaning up

One of the key benefits of Hyper is reducing your operations costs. To make sure that you’re not being billing for any resources that you’re not using, you should know how to clean up all resources once you are finished with them.

Note on rootFS billing
After running hyper stop you will still be billed for the rootFS volume. It is not deleted as you may later want to hyper start the container again. Only when you hyper rm the container will the container and rootFS volume be removed. Also, as with Docker, you can also perform both of the above commands in one go by using hyper rm -f <containername or containerID>.

So the total monthly price for running a Jenkins container at s4 size with an attached volume and FIP is $8.28. You can always check your current usage costs in the Hyper console.

Note on pricing
Remember that Hyper allows you to choose the size of your container at start time so the billing information above applies to this example only. Check the pricing page for more information: https://hyper.sh/pricing.html

That's it for part 1. In Part 2 we'll learn about working with multiple containers.