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

Docker: minimize build context when building Docker Images #1231

Closed
bschmalhofer opened this issue Sep 14, 2021 · 4 comments
Closed

Docker: minimize build context when building Docker Images #1231

bschmalhofer opened this issue Sep 14, 2021 · 4 comments
Assignees
Labels
tidying Tidying of the code
Milestone

Comments

@bschmalhofer
Copy link
Contributor

Just a small optimization. Not all images need the full otobo dir as build context.

@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Sep 14, 2021
@bschmalhofer bschmalhofer self-assigned this Sep 14, 2021
@bschmalhofer bschmalhofer added the tidying Tidying of the code label Sep 14, 2021
@bschmalhofer
Copy link
Contributor Author

It looks like the build context can't be set for the automated builds Docker Hub. A possible workaround is to add lookup table in hooks/build. Currently the build context is hardcoded as '.' in that script.

bschmalhofer added a commit that referenced this issue Sep 21, 2021
This works locally, but it is not obvious how Docker hub handles this.
bschmalhofer added a commit that referenced this issue Sep 21, 2021
Issue #1231: Tentatively change into scripts/nginx before building.
@bschmalhofer
Copy link
Contributor Author

The build context can be set in the automated build GUI. For some reason I must have overlooked it. That setting is available as $BUILD_PATH in hooks/build.
I adapted hooks/build such that the build context no longer is hardcoded to ".". Setting the build context to "/" indicating the git checkout dir is still supported.

The idea is to backport this to rel-10_0, as the directory structure hasn't really changed. The only thing to keep in mind is that hooks/build must be updated when an automated build from before 10.0.12 is needed.

@bschmalhofer
Copy link
Contributor Author

Minimised the build context:

  • nginx, nginx-kerberos: scripts/nginx
  • elasticsearch: _scripts/elasticsearch . actually an empty directory
  • selenium: scripts/test/sample

@bschmalhofer
Copy link
Contributor Author

Ran the test suite, with activated Elasticsearch, with the devel-rel-10_0 images taken from hub.docker.com. The test results looked fine. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidying Tidying of the code
Projects
None yet
Development

No branches or pull requests

1 participant