Skip to content

Instantly share code, notes, and snippets.

@clcollins
Last active May 15, 2019 15:16
Show Gist options
  • Save clcollins/6031900866a56a438b081b20e399a0e0 to your computer and use it in GitHub Desktop.
Save clcollins/6031900866a56a438b081b20e399a0e0 to your computer and use it in GitHub Desktop.
Working WIth Docker Hub

Working With Docker Hub

Documentation for creating/managing repositories and images for the STINGAR organization on Docker Hub.

NOTE: This should ONLY be done this way until we get some automation.

Before you start

Images are organized by Organization (STINGAR), Repostitory (mongodb), and tag (v1.1-centos, latest, etc).

"Repository" refers to the same general idea as the Github Repository.

Create a docs/Dockerhub.md for your project

  1. mkdir docs/
  2. touch docs/Dockerhub.md
  3. Fill out the Dockerhub.md from this template, replacing links and names, and commit it to your project:
# Supported tags and respective Dockerfile links

*  latest, 1.1, 1.1-centos \([Dockerfile-centos](https://github.com/CommunityHoneyNetwork/mongodb/blob/v1.1/Dockerfile-centos)\)
*  1.1, 1.1-ubuntu \([Dockerfile-ubuntu](https://github.com/CommunityHoneyNetwork/mongodb/blob/v1.1/Dockerfile-ubuntu)\)

# CommunityHoneyNetwork MongoDB

MongoDB implementation for use with the [CommunityHoneyNetwork](https://communityhoneynetwork.github.io/) project.

**Where to get help:**
the CommunityHoneyNetwork [mailing list](stingar@duke.edu)

**Where to file issues:**
https://github.com/CommunityHoneyNetwork/mongodb/issues

**Maintained by:**
the [CommunityHoneyNetwork]https://communityhoneynetwork.github.io) maintainers

**How to use this image:**

Check out the [CommunityHoneyNetwork documentation](https://communityhoneynetwork.github.io/)

Create A Repository

  1. Login to DockerHub
  2. Select "Create" -> "Repository"
  3. Choose the "stingar" organization, and enter the image name as it matches our documentation (eg. "mongodb")
  4. Enter the "Short Description" from the Dockerhub.md as the "Short Description", removing links. It must be less than 100 characters.
  5. Paste the contets of the Dockerhub.md into the "Full Description" field.
  6. Make sure "Visibility" is public

Add the Stingar organization admins as Collaborators

From the Repository:

  1. Select "Collaborators"
  2. Set the "owners" team as admins
  3. Select "Add team"

Build the supported tags

For each tag in the "Supported Tags" section, build a corresponding image.

Example:

# Checkout the published Git tag
git checkout v1.1

# Build the images
docker build -t stingar/mongodb:1.1-centos -f Dockerfile-centos .
docker build -t stingar/mongodb:1.1-ubuntu -f Dockerfile-ubuntu .

# Test the images, then continue...

# Tag the images
docker tag stingar/mongodb:1.1-centos stingar/mongodb:latest

# Login to DockerHub
docker login --username=<your username>

# Push your images
docker push stingar/mongodb:1.1-centos
docker push stingar/mongodb:latest
docker push stingar/mongodb:1.1-ubuntu

# LOGOUT (!!) of DockerHub
docker logout 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment