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

Fix Docker image build issues for new versions of Docker (25.0.2) and Docker Compose (2.24.3) #9303

Merged
merged 3 commits into from Feb 2, 2024

Conversation

tdonohue
Copy link
Member

@tdonohue tdonohue commented Feb 2, 2024

References

Description

Fixes the two errors described in #9302

  1. The networks error was fixed by ensuring all docker-compose files reference the dspacenet (external) network that is created in the main [src]/docker-compose.yml. This is based on the documentation here: https://docs.docker.com/compose/networking/#use-a-pre-existing-network
  2. The dspacesolr build error was fixed by using a new additional_contexts option available since docker compose version 2.17.0. This allows our main [src]/docker-compose.yml script to pass the path of the Solr configs to dspace/src/main/docker/dspace-solr/Dockerfile so that Dockerfile can locate the configurations necessary to build dspacesolr.

Instructions for Reviewers

  • Before this is merged we obviously must ensure it also works for GitHub actions/CI. This will be a good test that older versions of Docker / Docker Compose can still build these images as GitHub actions is currently using Docker v24.07 and Docker Compose v2.21.0

I'm still testing that all our Compose files now build (including those that are not used as frequently like IIIF and Shib).

Because this is a blocker for my ability to test 8.0 PRs (as I cannot get main to build), I plan to merge this immediately if everything is successful. Afterwards, I will also investigate whether this needs to be ported to dspace-angular (I suspect it does) and possibly also the dspace-7_x branches of both projects.

@tdonohue tdonohue added bug high priority backend: Docker Related to DSpace deployment via Docker 1 APPROVAL pull request only requires a single approval to merge. labels Feb 2, 2024
@tdonohue tdonohue force-pushed the fix_docker_issues branch 4 times, most recently from 92c0e11 to e457fb0 Compare February 2, 2024 16:55
@tdonohue
Copy link
Member Author

tdonohue commented Feb 2, 2024

NOTE: After discussion with @wwelling on Slack, I've realized that the dspacesolr build error might have been caused by a Windows bug in "docker compose": moby/moby#47231

However, I still feel the changes in this PR to use additional_contexts (to pass in the path of the Solr configs) seems like it may be more stable for the long term. That way the path to these configs can be passed in, rather than "assumed" by the Dockerfile.

@tdonohue tdonohue force-pushed the fix_docker_issues branch 2 times, most recently from c07d855 to cbf4f09 Compare February 2, 2024 17:51
@tdonohue
Copy link
Member Author

tdonohue commented Feb 2, 2024

Fully tested locally and alongside fixes to frontend in DSpace/dspace-angular#2791 This appears to fix the issue and appears to be compatible with older versions of Docker (as used in GitHub Actions)

@tdonohue tdonohue added the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Feb 2, 2024
@tdonohue tdonohue added this to the 8.0 milestone Feb 2, 2024
@tdonohue tdonohue merged commit f2f6e09 into DSpace:main Feb 2, 2024
22 checks passed
@dspace-bot
Copy link

Backport failed for dspace-7_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-7_x
git worktree add -d .worktree/backport-9303-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-9303-to-dspace-7_x
git switch --create backport-9303-to-dspace-7_x
git cherry-pick -x a84d2440a77dd8156b06a6a3d4135fb045bd6f5a 5f9565e267a18742e4192c29d17bcb6f9eaa1245 8fb4dd59549b004a9a7c7cbfedb75f4f5ca2f410

@tdonohue
Copy link
Member Author

tdonohue commented Feb 2, 2024

Ported manually to dspace-7_x in #9304

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge. backend: Docker Related to DSpace deployment via Docker bug high priority
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Docker images fail to build with new versions of Docker (25.0.2) and Docker Compose (2.24.3)
2 participants