Chapter 10 Docker Hub
This document covers the using Docker Hub (https://hub.docker.com/) to find images that will help as a starting point for the software container that will run your application.
10.1 Create an Account
Create an account at Docker Hub (https://hub.docker.com/) to be able to push
and pull
Docker Hub images.
10.2 Log Into Docker via Command Line
Use docker login
to log into DockerHub via the commandline.
docker login --help
- Use this to see the options for logging indocker login -u your_user_name
- The-u
option allows us to pass our user name.- Password - The prompt will request our password for DockerHub
10.3 Searching Docker Hub
Use docker search
to search for containers related to our project. Alternatively we can search on the DockerHub website.
docker search shiny
- Searches all instances where “shiny” is present. Sorts by DockerHub Stars.- NAME - Docker registry name
- STARS - Docker Hub Star count
10.4 Pulling an Image
Use docker pull
to pull an image from the DockerHub (remote) to your EC2 Server.
docker pull rocker/shiny-verse
- Pulls an image that containsshiny
server and thetidyverse
R packagesdocker pull rocker/tidyverse
(Not shown) - Pulls an image that containsRStudio
server andtidyverse
R packages
10.5 List the Docker Images
docker image ls
- List the local docker images installed on the EC2 Server.- Note that you will likely have fewer images
- Size - If you install many images, you can quickly eat up server space
10.6 Wrapup
Now you have the following Docker Images successfully installed on your EC2 Server:
rocker/shiny-verse
- Containsshiny
server and thetidyverse
R packagesrocker/tidyverse
- Containsrstudio
server and thetidyverse
R packages
Have a question? Leave a comment.