Skip to content

Commit 5760e7b

Browse files
authored
Merge branch 'master' into ecr_scan_on_push
2 parents 3501d9a + 7ade37a commit 5760e7b

File tree

4 files changed

+54
-42
lines changed

4 files changed

+54
-42
lines changed

.drone.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,43 @@ trigger:
7777
depends_on:
7878
- testing
7979

80-
---
81-
kind: pipeline
82-
type: ssh
83-
name: windows-1903-amd64-docker
84-
85-
platform:
86-
os: windows
87-
88-
server:
89-
host: windows.1903.amd64.plugins.drone.ci
90-
password:
91-
from_secret: windows_password
92-
user:
93-
from_secret: windows_username
94-
95-
steps:
96-
- name: build
97-
commands:
98-
# TODO use the new DRONE_SEMVER_SHORT environment variables to
99-
# publish docker images for tag events.
100-
- go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
101-
- docker login -u $env:USERNAME -p $env:PASSWORD
102-
- docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
103-
- docker push plugins/docker:windows-1903-amd64
104-
environment:
105-
CGO_ENABLED: "0"
106-
USERNAME:
107-
from_secret: docker_username
108-
PASSWORD:
109-
from_secret: docker_password
110-
111-
trigger:
112-
event:
113-
- push
114-
115-
depends_on:
116-
- testing
80+
# ---
81+
# kind: pipeline
82+
# type: ssh
83+
# name: windows-1903-amd64-docker
84+
85+
# platform:
86+
# os: windows
87+
88+
# server:
89+
# host: windows.1903.amd64.plugins.drone.ci
90+
# password:
91+
# from_secret: windows_password
92+
# user:
93+
# from_secret: windows_username
94+
95+
# steps:
96+
# - name: build
97+
# commands:
98+
# # TODO use the new DRONE_SEMVER_SHORT environment variables to
99+
# # publish docker images for tag events.
100+
# - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
101+
# - docker login -u $env:USERNAME -p $env:PASSWORD
102+
# - docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
103+
# - docker push plugins/docker:windows-1903-amd64
104+
# environment:
105+
# CGO_ENABLED: "0"
106+
# USERNAME:
107+
# from_secret: docker_username
108+
# PASSWORD:
109+
# from_secret: docker_password
110+
111+
# trigger:
112+
# event:
113+
# - push
114+
115+
# depends_on:
116+
# - testing
117117

118118
---
119119
kind: pipeline
@@ -441,11 +441,11 @@ trigger:
441441

442442
depends_on:
443443
- windows-1809-amd64-docker
444-
- windows-1903-amd64-docker
445444
- windows-1909-amd64-docker
446445
- linux-amd64-docker
447446
- linux-arm64-docker
448447
- linux-arm-docker
448+
# - windows-1903-amd64-dfocker
449449

450450
---
451451
kind: pipeline

cmd/drone-docker/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func main() {
5050
cli.StringFlag{
5151
Name: "daemon.mirror",
5252
Usage: "docker daemon registry mirror",
53-
EnvVar: "PLUGIN_MIRROR",
53+
EnvVar: "PLUGIN_MIRROR,DOCKER_PLUGIN_MIRROR",
5454
},
5555
cli.StringFlag{
5656
Name: "daemon.storage-driver",
@@ -216,7 +216,7 @@ func main() {
216216
cli.StringFlag{
217217
Name: "docker.config",
218218
Usage: "docker json dockerconfig content",
219-
EnvVar: "PLUGIN_CONFIG",
219+
EnvVar: "PLUGIN_CONFIG,DOCKER_PLUGIN_CONFIG",
220220
},
221221
cli.BoolTFlag{
222222
Name: "docker.purge",

docker.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (p Plugin) Exec() error {
9494
path := filepath.Join(dockerHome, "config.json")
9595
err := ioutil.WriteFile(path, []byte(p.Login.Config), 0600)
9696
if err != nil {
97-
return fmt.Errorf("Error writeing config.json: %s", err)
97+
return fmt.Errorf("Error writing config.json: %s", err)
9898
}
9999
}
100100

@@ -343,6 +343,10 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
343343
"--host=unix:///var/run/docker.sock",
344344
}
345345

346+
if _, err := os.Stat("/etc/docker/default.json"); err == nil {
347+
args = append(args, "--seccomp-profile=/etc/docker/default.json")
348+
}
349+
346350
if daemon.StorageDriver != "" {
347351
args = append(args, "-s", daemon.StorageDriver)
348352
}
@@ -373,7 +377,6 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
373377
return exec.Command(dockerdExe, args...)
374378
}
375379

376-
377380
// helper to check if args match "docker prune"
378381
func isCommandPrune(args []string) bool {
379382
return len(args) > 3 && args[2] == "prune"

docker/docker/Dockerfile.linux.arm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@ FROM arm32v6/docker:19.03.8-dind
22

33
ENV DOCKER_HOST=unix:///var/run/docker.sock
44

5+
RUN apk --update add --virtual .build-deps curl && \
6+
mkdir -p /etc/docker/ && \
7+
curl -SsL -o /etc/docker/default.json https://raw.githubusercontent.com/moby/moby/19.03/profiles/seccomp/default.json && \
8+
sed -i 's/SCMP_ACT_ERRNO/SCMP_ACT_TRACE/g' /etc/docker/default.json && \
9+
chmod 600 /etc/docker/default.json && \
10+
apk del .build-deps && \
11+
rm -rf /var/cache/apk/* && \
12+
rm -rf /tmp/*
13+
514
ADD release/linux/arm/drone-docker /bin/
615
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"]

0 commit comments

Comments
 (0)