Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Isdocker build --check used to validate Dockerfiles and check for warnings?#1359

Answeredbycrazy-max
johnthagen asked this question inQ&A
Discussion options

I'd like to ensure that my Dockerfile does not have any warnings and that it's validated in CI. If I use a simple job such as:

container:runs-on:ubuntu-24.04steps:      -name:Build Container Imageuses:docker/build-push-action@v6with:push:false

Will this fail ifdocker build --check fails? I don't see any documentation in the README about if lint warnings are checked. I think the documentation could be improved here.

If theyaren't checked, I'd propose a new

with:checked:true

flag so that users can lint their Dockerfiles using this action in CI.

References

You must be logged in to vote

Replies: 2 comments 3 replies

Comment options

You can use the inputcall and passcheck to it.

https://github.com/docker/build-push-action?tab=readme-ov-file#inputs

You must be logged in to vote
1 reply
@johnthagen
Comment options

@mschoettle So would this look like:

container:runs-on:ubuntu-24.04steps:      -name:Lint Dockerfileuses:docker/build-push-action@v6with:call:check

If I want to check and then actually build the container, would the most concise way of expressing this be the following? (i.e., I need to duplicate and have two separatedocker/build-push-action@v6 steps?

container:runs-on:ubuntu-24.04steps:      -name:Lint Dockerfileuses:docker/build-push-action@v6with:call:checksteps:      -name:Build Container Imageuses:docker/build-push-action@v6with:push:false
Comment options

We have docs for using Build checks in GHA:https://docs.docker.com/build/ci/github-actions/checks/

You must be logged in to vote
2 replies
@mschoettle
Comment options

I created#1361 to add this to the README in the examples section.

@johnthagen
Comment options

Perfect, yes I was going to recommend adding it to the README for greater visibility. Thanks.

Answer selected byjohnthagen
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@johnthagen@crazy-max@mschoettle

[8]ページ先頭

©2009-2025 Movatter.jp