Skip to content

Optimize Docker build by introducing shared runtime-deps stage#49

Merged
payneBrandon merged 5 commits intodevelopfrom
docker/reduce-installation-duplication
Sep 26, 2025
Merged

Optimize Docker build by introducing shared runtime-deps stage#49
payneBrandon merged 5 commits intodevelopfrom
docker/reduce-installation-duplication

Conversation

@dmccoystephenson
Copy link
Member

@dmccoystephenson dmccoystephenson commented Sep 15, 2025

Problem

Runtime dependencies were being installed separately in both the builder and runtime images. This duplication increased build times and added unnecessary complexity.

Solution

A new intermediate build stage, runtime-deps, has been added. Both the builder and runtime stages now reference this shared stage instead of installing runtime dependencies independently.

Testing

  • Verified do_kafka_test.sh script completes successfully
  • Confirmed all Dockerfile variants build without errors
  • Ensured the application starts up as expected
  • Verified BSM decoding functions correctly

Additional Changes

  • An entry to .gitignore was added for .pyc files
  • A health check was added to do_kafka_test.sh to give Kafka a moment to start before checking for topics

do_kafka_test.sh Outdated
}

waitForKafkaToCreateTopics() {
sleep 1 # give Kafka a moment to start

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: rather than sleep should we do a health check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for me, especially if Kafka takes more than a second to start on the user’s computer.

Copy link

@payneBrandon payneBrandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@payneBrandon payneBrandon merged commit 1bcd94b into develop Sep 26, 2025
3 checks passed
@payneBrandon payneBrandon deleted the docker/reduce-installation-duplication branch September 26, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants