From 2e3345025badbf88ee33bf33e68b17d7df8c0d1b Mon Sep 17 00:00:00 2001 From: Hilmar Falkenberg Date: Thu, 22 Aug 2024 13:28:17 +0200 Subject: [PATCH] bump alpine version and go version --- .github/workflows/push_ocm.yaml | 2 +- Dockerfile | 4 +- README.md | 2 +- .../extensions/repositories/docker/client.go | 78 ------------------- components/helminstaller/Dockerfile | 4 +- components/ocmcli/Dockerfile | 2 +- flake.nix | 2 +- go.mod | 2 +- 8 files changed, 9 insertions(+), 87 deletions(-) diff --git a/.github/workflows/push_ocm.yaml b/.github/workflows/push_ocm.yaml index 582987f173..1464ae0d38 100644 --- a/.github/workflows/push_ocm.yaml +++ b/.github/workflows/push_ocm.yaml @@ -63,7 +63,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - # supported platforms of https://hub.docker.com/_/golang/tags?page=1&name=1.22-alpine3.19 + # supported platforms of https://hub.docker.com/_/golang/tags?page=1&name=1.23-alpine3.20 # platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x push: true tags: | diff --git a/Dockerfile b/Dockerfile index 2364fc51bf..a7cd172537 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG GO_VERSION="1.22" -ARG ALPINE_VERSION="3.19" +ARG GO_VERSION="1.23" +ARG ALPINE_VERSION="3.20" FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build diff --git a/README.md b/README.md index e28e8c11a8..ab2001a0b7 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ You can pass in the following arguments to override the predefined defaults: Please check [hub.docker.com](https://hub.docker.com/_/golang/tags?page=1&name=alpine) for possible version combinations. ```bash -podman build -t ocm --build-arg GO_VERSION=1.22 --build-arg ALPINE_VERSION=3.19 --build-arg GO_PROXY=https://proxy.golang.org . +podman build -t ocm --build-arg GO_VERSION=1.23 --build-arg ALPINE_VERSION=3.20 --build-arg GO_PROXY=https://proxy.golang.org . ``` ## Examples diff --git a/api/oci/extensions/repositories/docker/client.go b/api/oci/extensions/repositories/docker/client.go index 0081c00983..6d66be26c1 100644 --- a/api/oci/extensions/repositories/docker/client.go +++ b/api/oci/extensions/repositories/docker/client.go @@ -34,81 +34,3 @@ func newDockerClient(dockerhost string) (*dockerclient.Client, error) { } return c, nil } - -/* - -const ( - // The default API version to be used in case none is explicitly specified. - defaultAPIVersion = "1.22" -) - - -// NewDockerClient initializes a new API client based on the passed SystemContext. -func newDockerClient2(host string) (*dockerclient.Client, error) { - if host == "" { - host = dockerclient.DefaultDockerHost - } - - // Sadly, unix:// sockets don't work transparently with dockerclient.NewClient. - // They work fine with a nil httpClient; with a non-nil httpClient, the transport’s - // TLSClientConfig must be nil (or the client will try using HTTPS over the PF_UNIX socket - // regardless of the values in the *tls.Config), and we would have to call sockets.ConfigureTransport. - // - // We don't really want to configure anything for unix:// sockets, so just pass a nil *http.Client. - // - // Similarly, if we want to communicate over plain HTTP on a TCP socket, we also need to set - // TLSClientConfig to nil. This can be achieved by using the form `http://` - url, err := dockerclient.ParseHostURL(host) - if err != nil { - return nil, err - } - var httpClient *http.Client - if url.Scheme != "unix" { - if url.Scheme == "http" { - httpClient = httpConfig() - } else { - hc, err := tlsConfig(nil) - if err != nil { - return nil, err - } - httpClient = hc - } - } - - return dockerclient.NewClient(host, defaultAPIVersion, httpClient, nil) -} - -func tlsConfig(sys *types.SystemContext) (*http.Client, error) { - options := tlsconfig.Options{} - if sys != nil && sys.DockerDaemonInsecureSkipTLSVerify { - options.InsecureSkipVerify = true - } - - if sys != nil && sys.DockerDaemonCertPath != "" { - options.CAFile = filepath.Join(sys.DockerDaemonCertPath, "ca.pem") - options.CertFile = filepath.Join(sys.DockerDaemonCertPath, "cert.pem") - options.KeyFile = filepath.Join(sys.DockerDaemonCertPath, "key.pem") - } - - tlsc, err := tlsconfig.Client(options) - if err != nil { - return nil, err - } - - return &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: tlsc, - }, - CheckRedirect: dockerclient.CheckRedirect, - }, nil -} - -func httpConfig() *http.Client { - return &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: nil, - }, - CheckRedirect: dockerclient.CheckRedirect, - } -} -*/ diff --git a/components/helminstaller/Dockerfile b/components/helminstaller/Dockerfile index 7356447b3f..008f78d481 100644 --- a/components/helminstaller/Dockerfile +++ b/components/helminstaller/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.22 AS builder +FROM --platform=$BUILDPLATFORM golang:1.23 AS builder ARG COMMIT EFFECTIVE_VERSION GIT_TREE_STATE ARG TARGETOS TARGETARCH @@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS ./cmds/helminstaller ################################################################################### -FROM alpine +FROM alpine:3.20.2 COPY --from=builder /main /toi/run ENTRYPOINT [ "/toi/run" ] diff --git a/components/ocmcli/Dockerfile b/components/ocmcli/Dockerfile index 5d183a7a67..dc5a504d7e 100644 --- a/components/ocmcli/Dockerfile +++ b/components/ocmcli/Dockerfile @@ -1,6 +1,6 @@ # This Dockerfile is used by `make` via the Makefile -ARG ALPINE_VERSION +ARG ALPINE_VERSION="3.20.2" FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} # Create group and user diff --git a/flake.nix b/flake.nix index b464edd38d..fd8e0ee41e 100644 --- a/flake.nix +++ b/flake.nix @@ -85,7 +85,7 @@ { default = pkgs.mkShell { buildInputs = with pkgs; [ - go_1_22 # golang 1.22 + go_1_23 # golang 1.23 gopls # go language server gotools # go imports go-tools # static checks diff --git a/go.mod b/go.mod index 0182bfcb62..40df1c6dca 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module ocm.software/ocm -go 1.22.5 +go 1.23.0 replace github.com/spf13/cobra => github.com/open-component-model/cobra v0.0.0-20230329075350-b1fd876abfb9