Skip to content

Instantly share code, notes, and snippets.

@omaciel
Created November 21, 2014 20:45
Show Gist options
  • Save omaciel/2fb2a739b8fd693b9f4e to your computer and use it in GitHub Desktop.
Save omaciel/2fb2a739b8fd693b9f4e to your computer and use it in GitHub Desktop.
Configuring Docker as Compute Resource for Satellite 6
  • Enable the "Extras" Red Hat channel so you can install Docker ...
#subscription-manager repos --enable rhel-7-server-extras-rpms
  • ... and install it
# yum install -y docker
  • Make sure to enable the docker service...
# systemctl enable docker
  • ... and that it can be run as the apache user (this may be dropped as the code matures)
# usermod -aG docker apache
  • Deal with SElinux (this may be dropped as the code matures)
# echo "OPTIONS=--selinux-enabled -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock" >> /etc/sysconfig/docker
  • Finally, start the docker service
# systemctl start docker
  • Test that Docker is working (you should see a similar output as shown below):
# docker ps
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES
  • Obtain a valid Docker image (use busybox for a fairly small and fast download; I chose to use fedora/ssh for this)
# docker pull fedora/ssh
  • Create a new "Docker" Compute Resource and use "http://localhost:2375" for its URL
    • The Test Connection button shows a spinner icon but no confirmation message is displayed to tell you whether things look ok or now

New Compute Resource

  • To create a new container, click the Containers and New container menus, and select the Docker compute resource you created before

Step1

  • Type fedora/ssh (case matters) in the search field and latest in the Tag field
    • NOTE: for some reason, it wasn't until I manually started a container manually with docker run --name myfedora -t fedora/ssh:latest that this part of the process verified that fedora/ssh was a valid entry by showing a green check mark.

Step2

  • Type a name for your container...

Step3

  • Click the TTY checkbox...

Step4

  • ...and your new container is ready to be started

New Container

  • ...and running

Running

  • You can see your container by going to the All containers submenu under the Containers menu.

All containers

@omaciel
Copy link
Author

omaciel commented Nov 21, 2014

When I opened the console for my container I see the following message: Could not load host key: /etc/ssh/ssh_host_ecdsa_key

@elyezer
Copy link

elyezer commented Nov 21, 2014

On RHEL6

# yum install -y docker-io
# echo "other_args=\"--selinux-enabled -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> /etc/sysconfig/docker

Same message on RHEL6 too: Could not load host key: /etc/ssh/ssh_host_ecdsa_key

@omaciel
Copy link
Author

omaciel commented Nov 21, 2014

Useful info: docker run -it --rm ubuntu:14.04 where ubuntu is a valid container name and 14.04 a valid target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment