Skip to content

Commit

Permalink
feat: implement support for network mode
Browse files Browse the repository at this point in the history
Breaking: new default network mode is `none` for any RUN steps.

Fixes #184

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Jan 29, 2025
1 parent 40ad501 commit 24a37b0
Show file tree
Hide file tree
Showing 14 changed files with 211 additions and 110 deletions.
12 changes: 12 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
"pin",
"digest"
]
},
{
"enabled": false,
"matchFileNames": [
"Dockerfile"
]
},
{
"enabled": false,
"matchFileNames": [
".github/workflows/*.yaml"
]
}
],
"separateMajorMinor": false
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-12-18T18:57:15Z by kres fcff05e.
# Generated on 2025-01-29T09:45:00Z by kres 987bf4d.

# options for analysis running
run:
Expand All @@ -17,7 +17,6 @@ output:
path: stdout
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
path-prefix: ""

# all available settings of specific linters
Expand Down Expand Up @@ -144,6 +143,7 @@ issues:
max-issues-per-linter: 10
max-same-issues: 3
new: false
uniq-by-line: true

severity:
default-severity: error
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-12-18T18:57:15Z by kres fcff05e.
# Generated on 2025-01-29T09:45:00Z by kres 987bf4d.

ARG TOOLCHAIN

Expand All @@ -11,7 +11,7 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.9.0 AS image-ca-certificates
FROM ghcr.io/siderolabs/fhs:v1.9.0 AS image-fhs

# runs markdownlint
FROM docker.io/oven/bun:1.1.40-alpine AS lint-markdown
FROM docker.io/oven/bun:1.1.43-alpine AS lint-markdown
WORKDIR /src
RUN bun i markdownlint-cli@0.43.0 sentences-per-line@0.3.0
COPY .markdownlint.json .
Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-12-18T18:57:15Z by kres fcff05e.
# Generated on 2025-01-29T09:45:00Z by kres 987bf4d.

# common variables

Expand All @@ -17,15 +17,15 @@ WITH_RACE ?= false
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.36.0
PROTOBUF_GO_VERSION ?= 1.36.2
GRPC_GO_VERSION ?= 1.5.1
GRPC_GATEWAY_VERSION ?= 2.24.0
GRPC_GATEWAY_VERSION ?= 2.25.1
VTPROTOBUF_VERSION ?= 0.6.0
GOIMPORTS_VERSION ?= 0.28.0
GOIMPORTS_VERSION ?= 0.29.0
DEEPCOPY_VERSION ?= v0.5.6
GOLANGCILINT_VERSION ?= v1.62.2
GOLANGCILINT_VERSION ?= v1.63.4
GOFUMPT_VERSION ?= v0.7.0
GO_VERSION ?= 1.23.4
GO_VERSION ?= 1.23.5
GO_BUILDFLAGS ?=
GO_LDFLAGS ?=
CGO_ENABLED ?= 0
Expand All @@ -41,13 +41,13 @@ PLATFORM ?= linux/amd64
PROGRESS ?= auto
PUSH ?= false
CI_ARGS ?=
BUILDKIT_MULTI_PLATFORM ?= 1
BUILDKIT_MULTI_PLATFORM ?=
COMMON_ARGS = --file=Dockerfile
COMMON_ARGS += --provenance=false
COMMON_ARGS += --progress=$(PROGRESS)
COMMON_ARGS += --platform=$(PLATFORM)
COMMON_ARGS += --push=$(PUSH)
COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=$(BUILDKIT_MULTI_PLATFORM)
COMMON_ARGS += --push=$(PUSH)
COMMON_ARGS += --build-arg=ARTIFACTS="$(ARTIFACTS)"
COMMON_ARGS += --build-arg=SHA="$(SHA)"
COMMON_ARGS += --build-arg=TAG="$(TAG)"
Expand Down Expand Up @@ -149,20 +149,23 @@ clean: ## Cleans up all artifacts.
target-%: ## Builds the specified target defined in the Dockerfile. The build result will only remain in the build cache.
@$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) .

registry-%: ## Builds the specified target defined in the Dockerfile and the output is an image. The image is pushed to the registry if PUSH=true.
@$(MAKE) target-$* TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/$(IMAGE_NAME):$(IMAGE_TAG)" BUILDKIT_MULTI_PLATFORM=1

local-%: ## Builds the specified target defined in the Dockerfile using the local output type. The build result will be output to the specified local destination.
@$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)"
@PLATFORM=$(PLATFORM) DEST=$(DEST) bash -c '\
for platform in $$(tr "," "\n" <<< "$$PLATFORM"); do \
echo $$platform; \
directory="$${platform//\//_}"; \
if [[ -d "$$DEST/$$directory" ]]; then \
echo $$platform; \
mv -f "$$DEST/$$directory/"* $$DEST; \
rmdir "$$DEST/$$directory/"; \
fi; \
done'

generate: ## Generate .proto definitions.
@$(MAKE) local-$@ DEST=./ BUILDKIT_MULTI_PLATFORM=0
@$(MAKE) local-$@ DEST=./

lint-golangci-lint: ## Runs golangci-lint linter.
@$(MAKE) target-$@
Expand Down Expand Up @@ -233,7 +236,7 @@ lint: lint-golangci-lint lint-gofumpt lint-govulncheck lint-markdown ## Run all

.PHONY: image-bldr
image-bldr: ## Builds image for bldr.
@$(MAKE) target-$@ TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/bldr:$(IMAGE_TAG)"
@$(MAKE) registry-$@ IMAGE_NAME="bldr"

.PHONY: integration.test
integration.test:
Expand Down
47 changes: 24 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ go 1.23.4
require (
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig/v3 v3.3.0
github.com/containerd/platforms v0.2.1
github.com/containerd/platforms v1.0.0-rc.1
github.com/emicklei/dot v1.6.4
github.com/google/go-github/v67 v67.0.0
github.com/hashicorp/go-multierror v1.1.1
github.com/moby/buildkit v0.18.2
github.com/moby/buildkit v0.19.0
github.com/moby/docker-image-spec v1.3.1
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0
github.com/otiai10/copy v1.14.0
github.com/otiai10/copy v1.14.1
github.com/siderolabs/gen v0.8.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.10.0
golang.org/x/oauth2 v0.24.0
golang.org/x/oauth2 v0.25.0
golang.org/x/sync v0.10.0
gopkg.in/yaml.v3 v3.0.1
)

require (
dario.cat/mergo v1.0.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/containerd/containerd v1.7.24 // indirect
github.com/containerd/errdefs v0.3.0 // indirect
github.com/containerd/containerd/v2 v2.0.2 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/ttrpc v1.2.5 // indirect
github.com/containerd/ttrpc v1.2.7 // indirect
github.com/containerd/typeurl/v2 v2.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
Expand All @@ -51,6 +51,7 @@ require (
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -60,20 +61,20 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tonistiigi/fsutil v0.0.0-20241121093142-31cf1f437184 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.66.3 // indirect
google.golang.org/protobuf v1.35.1 // indirect
github.com/tonistiigi/fsutil v0.0.0-20250113203817-b14e27f4135a // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/grpc v1.68.1 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading

0 comments on commit 24a37b0

Please sign in to comment.