Skip to content

dev/check: migrate no-alpine-guard to sg check docker

Warren Gifford requested to merge migrate-alpine-guard into main

Created by: bobheadxi

Migrate no-alpine-guard.sh to the new Dockerfile checker in sg check docker introduced in https://github.com/sourcegraph/sourcegraph/pull/31217. This original guard does a broad regex for all things alpine, and thus has a large list of growing exceptions - migrating it to the new checker lets us perform targetted checks against the main usage we are worried about, which is usage in Dockerfile FROM directives, in a more structured manner, without any bash.

image

This can be bypassed with:

+ # alpine_base CHECK:ALPINE_OK
- FROM alpine:3.12
+ FROM alpine:3.12 as alpine_base

Test plan

Manual test with failures (https://buildkite.com/sourcegraph/sourcegraph/builds/131685) and without failures. Also added unit tests.

Merge request reports

Loading