Skip to content

Commit 1120f02

Browse files
authored
Merge pull request #211289 from Homebrew/mintoolkit
docker-slim: rename to `mintoolkit`, mintoolkit 1.41.7 (new formula)
2 parents eb91eb6 + 0a7e89c commit 1120f02

File tree

4 files changed

+74
-58
lines changed

4 files changed

+74
-58
lines changed

.github/autobump.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@ docker-credential-helper-ecr
806806
docker-gen
807807
docker-machine
808808
docker-machine-driver-vultr
809-
docker-slim
810809
docker-squash
811810
dockerfile-language-server
812811
dockerfilegraph
@@ -2225,6 +2224,7 @@ miniupnpc
22252224
minizinc
22262225
minizip
22272226
minizip-ng
2227+
mintoolkit
22282228
minuit2
22292229
mist-cli
22302230
mk-configure

Formula/d/docker-slim.rb

Lines changed: 0 additions & 57 deletions
This file was deleted.

Formula/m/mintoolkit.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
class Mintoolkit < Formula
2+
desc "Minify and secure Docker images"
3+
homepage "https://slimtoolkit.org/"
4+
url "https://github.com/mintoolkit/mint/archive/refs/tags/1.41.7.tar.gz"
5+
sha256 "a5375339dda7752b8c7a1d29d25cc7e7e52c60b2badb6a3f6d816f7743fde91a"
6+
license "Apache-2.0"
7+
head "https://github.com/mintoolkit/mint.git", branch: "master"
8+
9+
livecheck do
10+
url :stable
11+
strategy :github_latest
12+
end
13+
14+
bottle do
15+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "3191425ab42a27ac181105eb522ba926cb52c2a6a7034b9cf697e34a41506627"
16+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "33e215a31ad61ca3f81951ca6863d406fd06a376ec10fd2e81f3ae058d6449e5"
17+
sha256 cellar: :any_skip_relocation, arm64_ventura: "485651b0b4be33e48ef7907f6239b83585e3028902c266fbab797b4c39bdd46a"
18+
sha256 cellar: :any_skip_relocation, sonoma: "c9c396b50f98b248eb69cafd4c800f6ad8ae8b25ed136fbcbeff4ec0ec9bc93c"
19+
sha256 cellar: :any_skip_relocation, ventura: "fa2b6fcf6dc740377b6400639d8d1fb00af713fd86f1c7b4027bbe2285f9dcbc"
20+
sha256 cellar: :any_skip_relocation, x86_64_linux: "dc9d72e0904771231b5c75d6444d6cbdc8d7185abeaa1cafb18257a731e98f8d"
21+
end
22+
23+
depends_on "go" => :build
24+
25+
on_linux do
26+
depends_on "btrfs-progs" => :build
27+
end
28+
29+
skip_clean "bin/mint-sensor"
30+
31+
def install
32+
system "go", "generate", "./pkg/appbom"
33+
ldflags = "-s -w -X github.com/mintoolkit/mint/pkg/version.appVersionTag=#{version}"
34+
tags = %w[
35+
remote
36+
containers_image_openpgp
37+
containers_image_docker_daemon_stub
38+
containers_image_fulcio_stub
39+
containers_image_rekor_stub
40+
]
41+
system "go", "build",
42+
*std_go_args(output: bin/"mint", ldflags:, tags:),
43+
"./cmd/mint"
44+
45+
# mint-sensor is a Linux binary that is used within Docker
46+
# containers rather than directly on the macOS host.
47+
ENV["GOOS"] = "linux"
48+
system "go", "build",
49+
*std_go_args(output: bin/"mint-sensor", ldflags:, tags:),
50+
"./cmd/mint-sensor"
51+
(bin/"mint-sensor").chmod 0555
52+
53+
# Create backwards compatible symlinks similar to build script
54+
# https://github.com/mintoolkit/mint/blob/master/scripts/src.build.sh
55+
bin.install_symlink "mint" => "docker-slim"
56+
bin.install_symlink "mint" => "slim"
57+
end
58+
59+
test do
60+
assert_match version.to_s, shell_output("#{bin}/mint --version")
61+
system "test", "-x", bin/"mint-sensor"
62+
63+
(testpath/"Dockerfile").write <<~DOCKERFILE
64+
FROM alpine
65+
RUN apk add --no-cache curl
66+
DOCKERFILE
67+
68+
output = shell_output("#{bin}/mint lint #{testpath}/Dockerfile")
69+
assert_match "Missing .dockerignore", output
70+
assert_match "Stage from latest tag", output
71+
end
72+
end

formula_renames.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"cv": "progress",
2929
"cyassl": "wolfssl",
3030
"d-bus": "dbus",
31+
"docker-slim": "mintoolkit",
3132
"fbida": "exiftran",
3233
"fcct": "butane",
3334
"ffmpeg28": "[email protected]",

0 commit comments

Comments
 (0)