Skip to content

Commit

Permalink
raise alpine version (#883)
Browse files Browse the repository at this point in the history
## Description

raise Alpine version to 3.20
  • Loading branch information
morri-son authored Aug 22, 2024
1 parent 31900ef commit db6c953
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push_ocm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
78 changes: 0 additions & 78 deletions api/oci/extensions/repositories/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
*/
4 changes: 2 additions & 2 deletions components/helminstaller/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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" ]
2 changes: 1 addition & 1 deletion components/ocmcli/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit db6c953

Please sign in to comment.