diff --git a/06-building-container-images/Makefile b/06-building-container-images/Makefile index 6286c83..9c2d4de 100644 --- a/06-building-container-images/Makefile +++ b/06-building-container-images/Makefile @@ -50,8 +50,8 @@ CMD and ENTRYPOINT. The image has the following: - ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ] - CMD [ "+ (cmd)" ] + ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ] + CMD [ "+ (cmd)" ] ✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅ diff --git a/06-building-container-images/client-react/Dockerfile.5 b/06-building-container-images/client-react/Dockerfile.5 index 76ddbcb..19310d8 100644 --- a/06-building-container-images/client-react/Dockerfile.5 +++ b/06-building-container-images/client-react/Dockerfile.5 @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1.5 + FROM node:19.4-bullseye AS build # Specify working directory other than / diff --git a/07-container-registries/Dockerfile b/07-container-registries/Dockerfile new file mode 100644 index 0000000..24ec1ac --- /dev/null +++ b/07-container-registries/Dockerfile @@ -0,0 +1,2 @@ +# Empty dockerfile to demonstrate pushing to registries +FROM scratch \ No newline at end of file diff --git a/07-container-registries/Makefile b/07-container-registries/Makefile new file mode 100644 index 0000000..5d504a6 --- /dev/null +++ b/07-container-registries/Makefile @@ -0,0 +1,23 @@ +.PHONY: build +build: + docker build --tag my-scratch-image . + +# Have to authenticate to dockerhub and create repo first: +# https://docs.docker.com/engine/reference/commandline/login/ +.PHONY: push-dockerhub +push-dockerhub: build + docker tag my-scratch-image sidpalas/my-scratch-image # defaults to latest + docker push sidpalas/my-scratch-image + + docker tag my-scratch-image sidpalas/my-scratch-image:abc-123 # defaults to latest + docker push sidpalas/my-scratch-image:abc-123 + +# Have to authenticate to ghcr.io first +# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry +.PHONY: push-github-packages +push-github-packages: build + docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image # defaults to latest + docker push ghcr.io/sidpalas/my-scratch-image + + docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image:abc-123 # defaults to latest + docker push ghcr.io/sidpalas/my-scratch-image:abc-123