File tree Expand file tree Collapse file tree
06-building-container-images Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ CMD and ENTRYPOINT.
5050
5151The image has the following:
5252
53- ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
54- CMD [ "+ (cmd)" ]
53+ ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
54+ CMD [ "+ (cmd)" ]
5555
5656✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅
5757
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.5
2+
13FROM node:19.4-bullseye AS build
24
35# Specify working directory other than /
Original file line number Diff line number Diff line change 1+ # Empty dockerfile to demonstrate pushing to registries
2+ FROM scratch
Original file line number Diff line number Diff line change 1+ .PHONY : build
2+ build :
3+ docker build --tag my-scratch-image .
4+
5+ # Have to authenticate to dockerhub and create repo first:
6+ # https://docs.docker.com/engine/reference/commandline/login/
7+ .PHONY : push-dockerhub
8+ push-dockerhub : build
9+ docker tag my-scratch-image sidpalas/my-scratch-image # defaults to latest
10+ docker push sidpalas/my-scratch-image
11+
12+ docker tag my-scratch-image sidpalas/my-scratch-image:abc-123 # defaults to latest
13+ docker push sidpalas/my-scratch-image:abc-123
14+
15+ # Have to authenticate to ghcr.io first
16+ # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry
17+ .PHONY : push-github-packages
18+ push-github-packages : build
19+ docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image # defaults to latest
20+ docker push ghcr.io/sidpalas/my-scratch-image
21+
22+ docker tag my-scratch-image ghcr.io/sidpalas/my-scratch-image:abc-123 # defaults to latest
23+ docker push ghcr.io/sidpalas/my-scratch-image:abc-123
You can’t perform that action at this time.
0 commit comments