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

Optimize Dockerfile and add .dockerignore #441

Merged
merged 8 commits into from Jul 26, 2023

Conversation

theinfosecguy
Copy link
Contributor

@theinfosecguy theinfosecguy commented Jul 12, 2023

Changes include:

  • Removed the mkdir command as the WORKDIR instruction automatically creates the folder if it doesn't already exist.

  • Added a .dockerignore file to prevent unnecessary files (such as README, tests, Dockerfile itself, etc.) from being included in the Docker context, thereby speeding up the build process.

  • Combined two RUN instructions into one in order to reduce the number of layers in the final image.

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks! The dockerfile updates look good, though I don't think the .dockerignore is necessary, as it might hinder us wanting to run tests in docker in the future, while not significantly speeding up the build process (there's not that many files being ignored).

Can you remove the .dockerignore?

@theinfosecguy
Copy link
Contributor Author

Can you remove the .dockerignore?

Removed the .dockerignore file.

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@theinfosecguy
Copy link
Contributor Author

@another-rex - can we merge this?

Dockerfile Outdated Show resolved Hide resolved
@another-rex
Copy link
Collaborator

Sorry for the delay, Just been testing Github actions recently and the relative ENTRYPOINT might cause problems, as github actions changes the working directory, and I haven't had time to test it out properly yet.

@another-rex another-rex enabled auto-merge (squash) July 26, 2023 01:26
@another-rex another-rex merged commit 77a22a3 into google:main Jul 26, 2023
5 checks passed
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.

None yet

2 participants