-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify registry build #20622
Open
kariya-mitsuru
wants to merge
1
commit into
goharbor:main
Choose a base branch
from
kariya-mitsuru:simplify-registry-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Simplify registry build #20622
kariya-mitsuru
wants to merge
1
commit into
goharbor:main
from
kariya-mitsuru:simplify-registry-build
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. `make/photon/Makefile` Remove `cd` command since the current directory is changed in `make/photon/registry/builder`. 2. `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.) 3. `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. (If `COPY` 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 to `COPY` command. (This will improve image build efficiency since the base image will not be extracted at build time.) 4. `make/photon/registry/builder`. - Move `set -e` (exit immediately on error) to the top. - There is no `error` command, so change it to the `echo` command. - Remove `cur` variables that are no longer used by using `~-` and `cd -`. - Add `--depth 1` option to `git 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 copying `Dockerfile.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. 5. `make/photon/registry/Dockerfile.binary`. - Remove `PREFIX` variable specified at `make` command line, since it is not used. - Change `make` build target from `binaries` to `bin/registry`. (Since `binaries` other than `bin/registry` are not used.) - Add a stage to extract only binary files, since `make/photon/registry/builder` now outputs binary files directly. Signed-off-by: Mitsuru Kariya <mitsuru.kariya@nttdata.com>
Vad1mo
approved these changes
Jul 9, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20622 +/- ##
==========================================
- Coverage 67.56% 66.25% -1.32%
==========================================
Files 991 1045 +54
Lines 109181 113476 +4295
Branches 2719 2845 +126
==========================================
+ Hits 73768 75183 +1415
- Misses 31449 34189 +2740
- Partials 3964 4104 +140
Flags with carried forward coverage won't be shown. Click here to find out more. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
/etc/pki/tls/certs
since the change has been moved to the base image.COPY
command is executed.(If
COPY
and the owner/permission changes were separated, both image layers before and after change would be created, making the image unnecessarily large.)--link
option toCOPY
command.(This will improve image build efficiency since the base image will not be extracted at build time.)
make/photon/registry/builder
.set -e
(exit immediately on error) to the top.error
command, so change it to theecho
command.cur
variables that are no longer used by using~-
andcd -
.--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.)
docker build
command to specify the source file directly with the-f
option instead of copyingDockerfile.binary
.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.make/photon/registry/Dockerfile.binary
.PREFIX
variable specified atmake
command line, since it is not used.make
build target frombinaries
tobin/registry
.(Since
binaries
other thanbin/registry
are not used.)make/photon/registry/builder
now outputs binary files directly.Issue being fixed
Please indicate you've done the following: