You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a second attempt at 98575e0:
> The goal of this directory is two-fold: to list the explicitly allowable external dependencies and to pin those external dependencies to a specific content-addressable digest such that we can update them in the same way we do everything else (and then trigger rebuilds properly based on them, too).
See `.external-pins/list.sh` for a useful summary of the assumptions that went into the naming scheme.
find "$dir" -mindepth 2 -type f -printf '%P\n'| sed -e 's/___/:/'| sort
7
+
8
+
# assumptions which make the "___" -> ":" conversion ~safe (examples referencing "example.com/foo/bar:baz"):
9
+
#
10
+
# 1. we *always* specify a tag ("baz")
11
+
# 2. the domain ("example.com") cannot contain underscores
12
+
# 3. we do not pin to any registry with a non-443 port ("example.com:8443")
13
+
# 4. the repository ("foo/bar") can only contain singular or double underscores (never triple underscore), and only between alphanumerics (thus never right up next to ":")
14
+
# 5. we do *not* use the "g" regex modifier in our sed, which means only the first instance of triple underscore is replaced (in pure Bash, that's "${img/:/___}" or "${img/___/:}" depending on the conversion direction)
15
+
#
16
+
# see https://github.com/distribution/distribution/blob/411d6bcfd2580d7ebe6e346359fa16aceec109d5/reference/regexp.go
17
+
# (see also https://github.com/docker-library/perl-bashbrew/blob/6685582f7889ef4806f0544b93f10640c7608b1a/lib/Bashbrew/RemoteImageRef.pm#L9-L26 for a condensed version)
18
+
#
19
+
# see https://github.com/docker-library/official-images/issues/13608 for why we can't just use ":" as-is (even though Linux, macOS, and even Windows via MSYS / WSL2 don't have any issues with it)
Copy file name to clipboardExpand all lines: .github/workflows/.bashbrew/action.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ runs:
10
10
11
11
# these two version numbers are intentionally as close together as I could possibly get them because no matter what I tried, GitHub will not allow me to DRY them (can't have any useful variables in `uses:` and can't even have YAML references to steal it in `env:` or something)
Copy file name to clipboardExpand all lines: README.md
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -119,11 +119,7 @@ When taking over an existing repository, please ensure that the entire Git histo
119
119
120
120
Rebuilding the same `Dockerfile` should result in the same version of the image being packaged, even if the second build happens several versions later, or the build should fail outright, such that an inadvertent rebuild of a `Dockerfile` tagged as `0.1.0` doesn't end up containing `0.2.3`. For example, if using `apt` to install the main program for the image, be sure to pin it to a specific version (ex: `... apt-get install -y my-package=0.1.0 ...`). For dependent packages installed by `apt` there is not usually a need to pin them to a version.
121
121
122
-
No official images can be derived from, or depend on, non-official images with the following notable exceptions:
No official images can be derived from, or depend on, non-official images (allowing the non-image [`scratch`](https://hub.docker.com/_/scratch/) and the intentionally limited exceptions pinned in [`.external-pins`](.external-pins) -- see also [`.external-pins/list.sh`](.external-pins/list.sh)).
) ;; # *technically* we should only whitelist these for "elasticsearch", "kibana", and "logstash" respectively, but the chances of other folks trying to use them in their images (*and* doing so without us noticing) seems low
37
+
38
+
*/*)
39
+
# must be external, let's check our pins for acceptability
40
+
local externalPinFile="$externalPinsDir/${from/:/___}"# see ".external-pins/list.sh"
41
+
if [ -s"$externalPinFile" ];then
42
+
local digest
43
+
digest="$(<"$externalPinFile")"
44
+
from+="@$digest"
45
+
else
46
+
# not pinned, must not be acceptable
47
+
return 0
48
+
fi
49
+
;;
52
50
esac
53
51
54
-
# must be some other official image AND support our current architecture
0 commit comments