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

Implement Environment Variables for Maven and GraalVM Versions in Dockerfile #402

Merged

Conversation

Surya-KN
Copy link
Contributor

@Surya-KN Surya-KN commented Dec 30, 2023

Fixes issue

Fixes #401

Changes proposed

Modified the Dockerfile to use environment variables for the Maven and GraalVM versions. This allows for easy version updates by simply changing the environment variables, eliminating the need for Dockerfile modifications.

The changes in this pull request will enhance the maintainability of Docker setup and streamline the process of testing application with different versions of Maven and GraalVM.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Summary by CodeRabbit

  • Chores

    • Updated development environment setup with dynamic version specification for Maven and GraalVM.
    • Improved environment variables and installation paths for better toolchain management.
  • Documentation

    • Provided a summary of the Dockerfile changes for setting up the development environment.

Copy link

vercel bot commented Dec 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drifty ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2023 9:09am

Copy link
Contributor

coderabbitai bot commented Dec 30, 2023

Walkthrough

The Dockerfile has been updated to introduce flexibility in version management for Maven and GraalVM by utilizing environment variables. This change simplifies the update process for these tools and enhances the capability to test the application with different versions, aligning with the goal of maintainable and adaptable development setup.

Changes

File Path Change Summary
Docker/dev/commons/base/Dockerfile Introduced environment variables MAVEN_MAJOR, MAVEN_VERSION, GRAAL_VERSION; changed installation paths to /opt; updated PATH, JAVA_HOME, GRAALVM_HOME.

Assessment against linked issues

Objective Addressed Explanation
Update Dockerfile to use environment variables for Maven and GraalVM versions (#401) The use of MAVEN_MAJOR, MAVEN_VERSION, and GRAAL_VERSION variables indicates that the Dockerfile now supports dynamic versioning for Maven and GraalVM.

Poem

To the tune of code, a 🐇 hops along,
No hardcoded strings, where they don't belong.
With variables set, and paths anew,
Our Dockerfile's flexible, as good as new! 🎉

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added the docker 🐋 Issues/Pull Requests regarding docker label Dec 30, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Yeah! You did it 🎉 Now, Relax 😉, Grab a drink ☕, and wait for the maintainers to check your contributions. Meanwhile, you can discuss on other issues and solve them 😀. Thank You 😃!

Meanwhile you can also discuss about the project in our Discord Server 😀

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 698e035 and 97bcb20.
Files ignored due to filter (1)
  • docker-compose.yaml
Files selected for processing (1)
  • Docker/dev/commons/base/Dockerfile (1 hunks)
Additional comments: 6
Docker/dev/commons/base/Dockerfile (6)
  • 14-14: The use of the MAVEN_MAJOR and MAVEN_VERSION variables in the wget command is a good practice for maintainability, but ensure that these variables are defined either in the Dockerfile or passed as build arguments.

  • 15-15: Similar to the Maven installation, verify that the GRAAL_VERSION variable is properly defined or passed to the Docker build context to avoid build errors.

  • 18-19: Creating symbolic links for Maven and GraalVM is a good practice for consistency and ease of use. However, ensure that these links do not conflict with any existing directories or links in the /opt directory.

  • 20-21: Removing the downloaded archive files is a good practice to reduce the Docker image size. This is a clean-up step that should be maintained.

  • 24-24: Updating the PATH environment variable to include Maven's bin directory is correct. This ensures that Maven commands can be run from any location within the container.

  • 25-26: Setting GRAALVM_HOME and JAVA_HOME to the GraalVM installation directory is appropriate. This ensures that Java-based applications can locate the correct JVM.

Docker/dev/commons/base/Dockerfile Show resolved Hide resolved
Docker/dev/commons/base/Dockerfile Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 97bcb20 and 15e6bfe.
Files selected for processing (1)
  • Docker/dev/commons/base/Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Docker/dev/commons/base/Dockerfile

Copy link
Owner

@SaptarshiSarkar12 SaptarshiSarkar12 left a comment

Choose a reason for hiding this comment

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

@Surya-KN The Maven download link does not get resolved. Please fix this issue.
image

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 15e6bfe and 1bece67.
Files ignored due to filter (1)
  • docker-compose.yaml
Files selected for processing (1)
  • Docker/dev/commons/base/Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Docker/dev/commons/base/Dockerfile

@Surya-KN
Copy link
Contributor Author

Surya-KN commented Dec 31, 2023

@Surya-KN The Maven download link does not get resolved. Please fix this issue.
image

I have made the changes, check it out @SaptarshiSarkar12

@SaptarshiSarkar12
Copy link
Owner

@Surya-KN Still not working
image

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1bece67 and 2638933.
Files ignored due to filter (1)
  • docker-compose.yaml
Files selected for processing (1)
  • Docker/dev/commons/base/Dockerfile (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Docker/dev/commons/base/Dockerfile

@Surya-KN
Copy link
Contributor Author

Surya-KN commented Dec 31, 2023

image
I have used build args instead of env variables @SaptarshiSarkar12

Copy link
Owner

@SaptarshiSarkar12 SaptarshiSarkar12 left a comment

Choose a reason for hiding this comment

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

@Surya-KN Looks good to merge 👍.
Thanks for contributing 🚀 🚀.
You may join our Discord server - https://discord.gg/DeT4jXPfkG to get updates about the project.

@SaptarshiSarkar12 SaptarshiSarkar12 merged commit ce9d037 into SaptarshiSarkar12:master Dec 31, 2023
15 checks passed
@SaptarshiSarkar12
Copy link
Owner

image I have used build args instead of env variables @SaptarshiSarkar12

Yeah, it's working now.
Thank you @Surya-KN 😄!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker 🐋 Issues/Pull Requests regarding docker feature ✨ New feature request or addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Dockerfile to use environment variables for Maven and GraalVM versions
2 participants