Skip to content

twogg-git/docker-registry-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Docker Registry Workshop

A quick workshop for Docker Registry.

Tools to use:

Working locally

We are going to start with an Apache httpd deploy. Here is our Dockerfile and a simple index.html file.

FROM httpd:2.4.39-alpine 
ADD index.html /usr/local/apache2/htdocs/
EXPOSE 80
<!DOCTYPE html>
<html>
<head>
  <title>Docker</title>
</head>
<body><center>
  <img src="https://raw.githubusercontent.com/twogg-git/talks/master/resources/dockerhub-talk/hub-index-httpd.png">
  <h1 style="color:purple">Baby steps with Docker Registry + HTTPD!</h1>   
</center></body>
</html>

Then build, test and commit locally

docker build -t httpd-test .
docker images
docker run --name httpd-test --rm -p 81:80 httpd-test
http://localhost:81/
docker container ls
docker commit httpd-test twogghub/httpd-test:version1

DockerHub Registry

We are going to use DockerHUb free registry, so you need to create an account here https://hub.docker.com/

Push a image into DockerHub

Now, push the images from our terminal following the dockerhub instructions.

docker login --username=twoggtest
docker tag httpd-test twoggtest/httpd:1.0
docker push twoggtest/httpd:1.0

DockerHub Automated Builds

If you want a personalized repo, go to Create Repository and select a connected git account.

Then setup your branch or tag tag and the autobild triggers.

docker build -t twoggtest/golang:1.0 .
docker run --name twoggtest-golang --rm -p 8081:8080 twoggtest/golang:1.0
docker push twoggtest/golang:1.0