A quick workshop for Docker Registry.
Tools to use:
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>
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
We are going to use DockerHUb free registry, so you need to create an account here https://hub.docker.com/
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
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