Skip to content

Commit 58f896d

Browse files
authored
Merge pull request #79 from code-dot-org/docker-go-upgrade
Upgrade Docker client to v25 (API 1.44) and move build to Go 1.21
2 parents 9ea626a + 3fdaef3 commit 58f896d

File tree

5 files changed

+175
-112
lines changed

5 files changed

+175
-112
lines changed

.drone.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ platform:
1111

1212
steps:
1313
- name: test
14-
image: golang:1.16
14+
image: golang:1.21
1515
commands:
1616
- go test -cover ./...
1717
volumes:
1818
- name: go
1919
path: /go
2020

2121
- name: build
22-
image: golang:1.16
22+
image: golang:1.21
2323
commands:
2424
- sh scripts/build.sh
2525
volumes:
@@ -43,15 +43,15 @@ pool:
4343

4444
steps:
4545
- name: environment
46-
image: golang:1.16
46+
image: golang:1.21
4747
pull: always
4848
environment:
4949
CGO_ENABLED: "0"
5050
commands:
5151
- go version
5252
- go env
5353
- name: build
54-
image: golang:1.16
54+
image: golang:1.21
5555
environment:
5656
CGO_ENABLED: "0"
5757
commands:
@@ -96,15 +96,15 @@ pool:
9696

9797
steps:
9898
- name: environment
99-
image: golang:1.16
99+
image: golang:1.21
100100
pull: always
101101
environment:
102102
CGO_ENABLED: "0"
103103
commands:
104104
- go version
105105
- go env
106106
- name: build
107-
image: golang:1.16
107+
image: golang:1.21
108108
environment:
109109
CGO_ENABLED: "0"
110110
commands:
@@ -149,15 +149,15 @@ pool:
149149

150150
steps:
151151
- name: environment
152-
image: golang:1.16
152+
image: golang:1.21
153153
pull: always
154154
environment:
155155
CGO_ENABLED: "0"
156156
commands:
157157
- go version
158158
- go env
159159
- name: build
160-
image: golang:1.16
160+
image: golang:1.21
161161
environment:
162162
CGO_ENABLED: "0"
163163
commands:
@@ -203,15 +203,15 @@ pool:
203203

204204
steps:
205205
- name: environment
206-
image: golang:1.16
206+
image: golang:1.21
207207
pull: always
208208
environment:
209209
CGO_ENABLED: "0"
210210
commands:
211211
- go version
212212
- go env
213213
- name: build
214-
image: golang:1.16
214+
image: golang:1.21
215215
environment:
216216
CGO_ENABLED: "0"
217217
commands:

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1. Install go 1.13 or higher
1+
1. Install go 1.21 or higher
22
2. Test
33

44
go test ./...

engine/engine.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (e *Docker) Setup(ctx context.Context, specv runtime.Spec) error {
7171
if vol.EmptyDir == nil {
7272
continue
7373
}
74-
_, err := e.client.VolumeCreate(ctx, volume.VolumeCreateBody{
74+
_, err := e.client.VolumeCreate(ctx, volume.CreateOptions{
7575
Name: vol.EmptyDir.ID,
7676
Driver: "local",
7777
Labels: vol.EmptyDir.Labels,
@@ -261,6 +261,7 @@ func (e *Docker) create(ctx context.Context, spec *Spec, step *Step, output io.W
261261
toConfig(spec, step),
262262
toHostConfig(spec, step),
263263
toNetConfig(spec, step),
264+
nil,
264265
step.ID,
265266
)
266267

@@ -285,6 +286,7 @@ func (e *Docker) create(ctx context.Context, spec *Spec, step *Step, output io.W
285286
toConfig(spec, step),
286287
toHostConfig(spec, step),
287288
toNetConfig(spec, step),
289+
nil,
288290
step.ID,
289291
)
290292
}

go.mod

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,64 @@
11
module github.com/drone-runners/drone-runner-docker
22

3-
go 1.16
4-
5-
replace github.com/docker/docker => github.com/docker/engine v17.12.0-ce-rc1.0.20200309214505-aa6a9891b09c+incompatible
3+
go 1.21
64

75
require (
8-
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
9-
github.com/Microsoft/go-winio v0.4.11 // indirect
10-
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
11-
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
126
github.com/buildkite/yaml v2.1.0+incompatible
13-
github.com/containerd/containerd v1.3.4 // indirect
147
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
158
github.com/docker/distribution v2.7.1+incompatible
16-
github.com/docker/docker v0.0.0-00010101000000-000000000000
17-
github.com/docker/go-connections v0.3.0 // indirect
9+
github.com/docker/docker v25.0.6+incompatible
1810
github.com/drone/drone-go v1.7.1
1911
github.com/drone/envsubst v1.0.3
2012
github.com/drone/runner-go v1.12.0
2113
github.com/drone/signal v1.0.0
2214
github.com/ghodss/yaml v1.0.0
23-
github.com/gogo/protobuf v0.0.0-20170307180453-100ba4e88506 // indirect
24-
github.com/google/go-cmp v0.3.0
25-
github.com/gorilla/mux v1.7.4 // indirect
15+
github.com/google/go-cmp v0.7.0
2616
github.com/joho/godotenv v1.3.0
2717
github.com/kelseyhightower/envconfig v1.4.0
28-
github.com/kr/pretty v0.1.0 // indirect
2918
github.com/mattn/go-isatty v0.0.8
19+
github.com/sirupsen/logrus v1.9.3
20+
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
21+
gopkg.in/alecthomas/kingpin.v2 v2.2.6
22+
)
23+
24+
require (
25+
github.com/99designs/basicauth-go v0.0.0-20160802081356-2a93ba0f464d // indirect
26+
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e // indirect
27+
github.com/Microsoft/go-winio v0.4.14 // indirect
28+
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
29+
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
30+
github.com/bmatcuk/doublestar v1.1.1 // indirect
31+
github.com/containerd/log v0.1.0 // indirect
32+
github.com/coreos/go-semver v0.3.0 // indirect
33+
github.com/distribution/reference v0.6.0 // indirect
34+
github.com/docker/go-connections v0.5.0 // indirect
35+
github.com/docker/go-units v0.4.0 // indirect
36+
github.com/felixge/httpsnoop v1.0.4 // indirect
37+
github.com/go-logr/logr v1.3.0 // indirect
38+
github.com/go-logr/stdr v1.2.2 // indirect
39+
github.com/gogo/protobuf v1.3.2 // indirect
40+
github.com/hashicorp/errwrap v1.0.0 // indirect
41+
github.com/hashicorp/go-multierror v1.0.0 // indirect
42+
github.com/kr/pretty v0.3.1 // indirect
43+
github.com/moby/term v0.5.2 // indirect
3044
github.com/morikuni/aec v1.0.0 // indirect
31-
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
45+
github.com/natessilva/dag v0.0.0-20180124060714-7194b8dcc5c4 // indirect
46+
github.com/opencontainers/go-digest v1.0.0 // indirect
3247
github.com/opencontainers/image-spec v1.0.1 // indirect
33-
github.com/pkg/errors v0.8.1 // indirect
34-
github.com/sirupsen/logrus v1.4.2
35-
github.com/stretchr/testify v1.3.0 // indirect
36-
golang.org/x/sync v0.0.0-20190423024810-112230192c58
48+
github.com/pkg/errors v0.9.1 // indirect
49+
github.com/rogpeppe/go-internal v1.10.0 // indirect
50+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
51+
go.opentelemetry.io/otel v1.21.0 // indirect
52+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect
53+
go.opentelemetry.io/otel/metric v1.21.0 // indirect
54+
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
55+
go.opentelemetry.io/otel/trace v1.21.0 // indirect
56+
golang.org/x/crypto v0.21.0 // indirect
57+
golang.org/x/net v0.23.0 // indirect
58+
golang.org/x/sys v0.18.0 // indirect
59+
golang.org/x/text v0.14.0 // indirect
3760
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
38-
google.golang.org/grpc v1.29.1 // indirect
39-
gopkg.in/alecthomas/kingpin.v2 v2.2.6
40-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
61+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
4162
gopkg.in/yaml.v2 v2.2.2 // indirect
42-
gotest.tools v2.2.0+incompatible // indirect
63+
gotest.tools/v3 v3.5.2 // indirect
4364
)

0 commit comments

Comments
 (0)