Skip to content
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

Reduce GoCD Server and Agent Docker Image size #6826

Merged

Conversation

@GaneshSPatil
Copy link
Contributor

commented Aug 26, 2019

  • Perform chmod and chown operations on go-{agent,server} dirs as part of
    the same docker layer (same as of unzip jar layer)
Reduce GoCD Server and Agent Docker Image size
* Perform chmod and chown operations on go-{agent,server} dirs as part of
  the same docker layer (same as of unzip jar layer)

@GaneshSPatil GaneshSPatil self-assigned this Aug 26, 2019

@GaneshSPatil GaneshSPatil requested a review from ketan Aug 27, 2019

@GaneshSPatil

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

@ketan -- with these changes, the size of the docker image has reduced (significantly).

The additional chown/chmod layer used to add the exact same size as of the go-{server,agent} files (30.6MB for Agent and 204MB for Server). With these changes, the size of that layer has been reduced to a few KBs.

GoCD Server

Screen Shot 2019-08-27 at 9 01 29 AM

GoCD Agent

Screen Shot 2019-08-27 at 9 06 28 AM

@@ -90,8 +93,8 @@ COPY --chown=go:root agent-bootstrapper-logback-include.xml agent-launcher-logba
COPY --chown=root:root dockerd-sudo /etc/sudoers.d/dockerd-sudo
</#if>

RUN chown -R go:root /go-agent /docker-entrypoint.d /go /godata /docker-entrypoint.sh \
&& chmod -R g=u /go-agent /docker-entrypoint.d /go /godata /docker-entrypoint.sh
RUN chown -R go:root /docker-entrypoint.d /go /godata /docker-entrypoint.sh \

This comment has been minimized.

Copy link
@GaneshSPatil

GaneshSPatil Aug 27, 2019

Author Contributor

/docker-entrypoint.d, /go and /godata are empty directories chown/chmod on empty directories will not add additional filesize.

This comment has been minimized.

Copy link
@GaneshSPatil

GaneshSPatil Aug 27, 2019

Author Contributor

Whereas, chmod/chown on /docker-entrypoint.sh file will add additional filesize (same as of the size of the docker-entrypoint.sh).

There is no workaround/way for this (as of today), as ADD command in docker does not support --chmod flag (it supports --chown).

@GaneshSPatil GaneshSPatil changed the title [WIP] [DNM] Reduce GoCD Server and Agent Docker Image size Reduce GoCD Server and Agent Docker Image size Aug 27, 2019

@GaneshSPatil GaneshSPatil added this to the Release 19.8.0 milestone Aug 27, 2019

@GaneshSPatil GaneshSPatil merged commit b46a060 into gocd:master Aug 27, 2019

6 of 8 checks passed

build-linux-PR/build-non-server
Details
build-windows-PR/build-non-server
Details
Mergeable Result: success
Details
WIP Ready for review
Details
installers-PR/dist
Details
installers-PR/docker
Details
license/cla Contributor License Agreement is signed.
Details
trigger/do-nothing
Details

@maheshp maheshp added this to Done in 19.8.0 Aug 27, 2019

@rajiesh rajiesh moved this from Done to QA Done in 19.8.0 Sep 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.