You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							57 lines
						
					
					
						
							1.9 KiB
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							57 lines
						
					
					
						
							1.9 KiB
						
					
					
				| name: Hadolint | |
| permissions: {} | |
| 
 | |
| on: [ push, pull_request ] | |
| 
 | |
| jobs: | |
|   hadolint: | |
|     name: Validate Dockerfile syntax | |
|     permissions: | |
|       contents: read | |
|     runs-on: ubuntu-24.04 | |
|     timeout-minutes: 30 | |
| 
 | |
|     steps: | |
|       # Start Docker Buildx | |
|       - name: Setup Docker Buildx | |
|         uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
|         # https://github.com/moby/buildkit/issues/3969 | |
|         # Also set max parallelism to 2, the default of 4 breaks GitHub Actions and causes OOMKills | |
|         with: | |
|           buildkitd-config-inline: | | |
|             [worker.oci] | |
|               max-parallelism = 2             | |
|           driver-opts: | | |
|                         network=host | |
| 
 | |
|       # Download hadolint - https://github.com/hadolint/hadolint/releases | |
|       - name: Download hadolint | |
|         shell: bash | |
|         run: | | |
|           sudo curl -L https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint && \ | |
|           sudo chmod +x /usr/local/bin/hadolint           | |
|         env: | |
|           HADOLINT_VERSION: 2.12.0 | |
|       # End Download hadolint | |
|       # Checkout the repo | |
|       - name: Checkout | |
|         uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 | |
|         with: | |
|           persist-credentials: false | |
|       # End Checkout the repo | |
| 
 | |
|       # Test Dockerfiles with hadolint | |
|       - name: Run hadolint | |
|         shell: bash | |
|         run: hadolint docker/Dockerfile.{debian,alpine} | |
|       # End Test Dockerfiles with hadolint | |
| 
 | |
|       # Test Dockerfiles with docker build checks | |
|       - name: Run docker build check | |
|         shell: bash | |
|         run: | | |
|           echo "Checking docker/Dockerfile.debian" | |
|           docker build --check . -f docker/Dockerfile.debian | |
|           echo "Checking docker/Dockerfile.alpine" | |
|           docker build --check . -f docker/Dockerfile.alpine           | |
|       # End Test Dockerfiles with docker build checks
 | |
| 
 |