Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade deps #7

Merged
merged 4 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.22
- name: Install dependencies
run: go get -t -v ./...
working-directory: ./builder
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Pull image
run: docker pull ${{ needs.build-image.outputs.image }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::891426818781:role/github-actions-integration-tests
aws-region: us-east-1
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Pull image
run: docker pull ${{ needs.build-image.outputs.image }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::891426818781:role/github-actions-integration-tests
aws-region: us-east-1
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
- name: Pull image
run: docker pull ${{ needs.build-image.outputs.image }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::891426818781:role/github-actions-integration-tests
aws-region: us-east-1
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
- name: Pull image
run: docker pull ${{ needs.build-image.outputs.image }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::891426818781:role/github-actions-integration-tests
aws-region: us-east-1
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
docker tag ${{ needs.build-image.outputs.image }} "$ECR_REPO:builder"
docker tag ${{ needs.build-image.outputs.image }} "$ECR_REPO:${{ github.ref_name }}"
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::101287669015:role/codebuild-image-github-actions"
aws-region: us-east-1
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM golang:1.19-alpine as builder
FROM golang:1.22-alpine as builder
RUN apk add --no-cache curl
# last pack version that supports heroku/buildpacks:20 builder
ENV PACK_VER=0.31.0
RUN set -ex && \
cd /tmp && \
curl -sLO https://github.com/buildpacks/pack/releases/download/v0.28.0/pack-v0.28.0-linux.tgz && \
tar xvzf pack-v0.28.0-linux.tgz
curl -sLO "https://github.com/buildpacks/pack/releases/download/v$PACK_VER/pack-v$PACK_VER-linux.tgz" && \
tar xvzf "pack-v$PACK_VER-linux.tgz"

WORKDIR /go/src/github.com/apppackio/codebuild-image/builder
COPY ./builder .
RUN go build -o /go/bin/apppack-builder main.go

FROM docker:23-dind
FROM docker:26-dind
COPY --from=builder /tmp/pack /usr/local/bin/pack
RUN apk add --no-cache git
COPY --from=builder /go/bin/apppack-builder /usr/local/bin/apppack-builder
6 changes: 3 additions & 3 deletions builder/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (c *Containers) RunContainer(name string, networkID string, config *contain
if err != nil {
return err
}
return c.cli.ContainerStart(c.ctx, *containerID, apiTypes.ContainerStartOptions{})
return c.cli.ContainerStart(c.ctx, *containerID, container.StartOptions{})
}

func (c *Containers) GetContainerFile(containerID string, src string) (io.ReadCloser, error) {
Expand Down Expand Up @@ -180,7 +180,7 @@ func (c *Containers) AttachLogs(containerID string, stdout, stderr io.Writer) er
c.Log().Debug().Str("container", containerID).Msg("attaching to logs of container")
// stream stdout and stderr from the container to the host
// use stdcopy to separate the streams
reader, err := c.cli.ContainerLogs(c.ctx, containerID, apiTypes.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true})
reader, err := c.cli.ContainerLogs(c.ctx, containerID, container.LogsOptions{ShowStdout: true, ShowStderr: true, Follow: true})
if err != nil {
return err
}
Expand All @@ -191,7 +191,7 @@ func (c *Containers) AttachLogs(containerID string, stdout, stderr io.Writer) er

func (c *Containers) DeleteContainer(containerID string) error {
c.Log().Debug().Str("container", containerID).Msg("deleting container")
return c.cli.ContainerRemove(c.ctx, containerID, apiTypes.ContainerRemoveOptions{Force: true})
return c.cli.ContainerRemove(c.ctx, containerID, container.RemoveOptions{Force: true})
}

func (c *Containers) BuildImage(dockerfile string, config *BuildConfig) error {
Expand Down
126 changes: 65 additions & 61 deletions builder/go.mod
Original file line number Diff line number Diff line change
@@ -1,86 +1,90 @@
module github.com/apppackio/codebuild-image/builder

go 1.19
go 1.22

require (
github.com/BurntSushi/toml v1.2.1
github.com/aws/aws-sdk-go v1.44.19
github.com/aws/aws-sdk-go-v2 v1.17.3
github.com/aws/aws-sdk-go-v2/config v1.18.11
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.25.0
github.com/aws/aws-sdk-go-v2/service/ecr v1.18.0
github.com/aws/aws-sdk-go-v2/service/ssm v1.35.0
github.com/docker/cli v23.0.0-rc.3+incompatible
github.com/docker/docker v23.0.0-rc.3+incompatible
github.com/otiai10/copy v1.9.0
github.com/rs/zerolog v1.28.0
github.com/spf13/afero v1.9.3
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.8.1
github.com/BurntSushi/toml v1.3.2
github.com/aws/aws-sdk-go v1.52.2
github.com/aws/aws-sdk-go-v2 v1.26.1
github.com/aws/aws-sdk-go-v2/config v1.27.11
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.0
github.com/aws/aws-sdk-go-v2/service/ecr v1.27.4
github.com/aws/aws-sdk-go-v2/service/ssm v1.50.0
github.com/docker/cli v26.1.1+incompatible
github.com/docker/docker v26.1.1+incompatible
github.com/google/go-containerregistry v0.19.1
github.com/otiai10/copy v1.14.0
github.com/rs/zerolog v1.32.0
github.com/spf13/afero v1.11.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/containerd/stargz-snapshotter/estargz v0.12.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/gabriel-vasile/mimetype v1.4.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
golang.org/x/sync v0.1.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.2 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-containerregistry v0.13.0
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/seqsense/s3sync v1.8.2
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.14.0 // indirect
github.com/seqsense/s3sync v1.9.1
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading