harbor
harbor copied to clipboard
Simplify registry build
Comprehensive Summary of your change
-
make/photon/Makefile
Remove
cd
command since the current directory is changed inmake/photon/registry/builder
. -
make/photon/registry/Dockerfile.base
Change the owner of
/etc/pki/tls/certs
when building the base image. (Since files under/etc/pki/tls/certs
are not affected by binary build.) -
make/photon/registry/Dockerfile
- Remove changing the owner of
/etc/pki/tls/certs
since the change has been moved to the base image. - The owner/permission changes of files copied from the context are now performed simultaneously when the
COPY
command is executed. (IfCOPY
and the owner/permission changes were separated, both image layers before and after change would be created, making the image unnecessarily large.) - Add
--link
option toCOPY
command. (This will improve image build efficiency since the base image will not be extracted at build time.)
- Remove changing the owner of
-
make/photon/registry/builder
.- Move
set -e
(exit immediately on error) to the top. - There is no
error
command, so change it to theecho
command. - Remove
cur
variables that are no longer used by using~-
andcd -
. - Add
--depth 1
option togit clone
command. (Since we only need the specified version of the source to build, we don't need the whole history, and this reduces the amount of transfer at clone time.) - Change the
docker build
command to specify the source file directly with the-f
option instead of copyingDockerfile.binary
. - Change the
docker build
command to directly output the binary file without creating a container image and container by specifying the output directory with the-o
option.
- Move
-
make/photon/registry/Dockerfile.binary
.- Remove
PREFIX
variable specified atmake
command line, since it is not used. - Change
make
build target frombinaries
tobin/registry
. (Sincebinaries
other thanbin/registry
are not used.) - Add a stage to extract only binary files, since
make/photon/registry/builder
now outputs binary files directly.
- Remove
Issue being fixed
Please indicate you've done the following:
- [x] Well Written Title and Summary of the PR
- [ ] Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
- [x] Accepted the DCO. Commits without the DCO will delay acceptance.
- [x] Made sure tests are passing and test coverage is added if needed.
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.