File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
scripts/build-path/git/ssh/private Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ IMG_NAME=docker.tutorials:build-path-git-ssh-private
2+ export DOCKER_BUILDKIT=1
3+
4+ # By using this to build docker image, a `Dockerfile` is
5+ # required at root directory.
6+ #
7+ # # This build will fail because the SSH key is not
8+ # # provided. It's not recommended adding SSH key via
9+ # # `Dockerfile` because it can be seen in the build log
10+ # # as plain text.
11+ # # The best practice is using `--ssh` to pass SSH clinet
12+ # # agent to docker deamon and use `git clone` in the
13+ # # `Dockerfile`.
14+ REPO=git@github.com:OttoHung/private-test.git#main
15+
16+ echo " Start to build docker image from: ${REPO} "
17+
18+ # Build docker image from public git repository via HTTPS
19+ #
20+ # The path of `Dockerfile` is not required because this
21+ # approach gathers `Dockerfile` from repository.
22+ docker build \
23+ --secret id=npm,src=$HOME /.npmrc \
24+ --no-cache \
25+ -t ${IMG_NAME} \
26+ ${REPO}
You can’t perform that action at this time.
0 commit comments