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

Add Dockerfile linting #381

Closed
SMoraisAnsys opened this issue Jan 3, 2024 · 2 comments
Closed

Add Dockerfile linting #381

SMoraisAnsys opened this issue Jan 3, 2024 · 2 comments
Labels
enhancement General improvements to existing features

Comments

@SMoraisAnsys
Copy link
Contributor

📝 Description of the feature

After using hadolint on a project, I was reminded of some good practices when writing a Dockerfile.
Adding this lint to ansys repos should be of great help to increase the quality of our products.

After some discussion with @RobPasMue the idea would be to:

  • add a step to the code-style action with some checking on the directory to check
  • create an independent public action as code-style action gets removed in favor of using pre-commit.ci.

Note: the action can either leverage hadolint-action or hadolint-gh-action.

💡 Steps for implementing the feature

We have to be carefull of the way we want to discover and check multiple dockerfiles as hadolint-action and hadolint-gh-action do not work in the same way when trying to deal with multiple dockerfiles.

🔗 Useful links and references

No response

@SMoraisAnsys SMoraisAnsys added the enhancement General improvements to existing features label Jan 3, 2024
@RobPasMue
Copy link
Member

RobPasMue commented Jan 3, 2024

My suggestion would be to:

  • Create a wrapped hadolint-action/hadolint-gh-action (e.g. docker-style?).
  • From the code-syle action, simply call the docker-style action. You could even surface this step as "optional" through a boolean to the code-style action
  • The docker-style action should verify that a user has (at least) a "docker" folder that contains the repository's Dockerfiles. Dockerfiles shouldn't be placed anywhere else. Then, you simply run the hadolint-* action with some predefined inputs to ensure consistency across our repos.

@SMoraisAnsys
Copy link
Contributor Author

Closed by #382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General improvements to existing features
Projects
None yet
Development

No branches or pull requests

2 participants