Skip to content

Commit

Permalink
Merge branch 'master' into ecr_scan_on_push
Browse files Browse the repository at this point in the history
  • Loading branch information
rvoitenko authored Feb 20, 2021
2 parents 3501d9a + 7ade37a commit 5760e7b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 42 deletions.
76 changes: 38 additions & 38 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,43 @@ trigger:
depends_on:
- testing

---
kind: pipeline
type: ssh
name: windows-1903-amd64-docker

platform:
os: windows

server:
host: windows.1903.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username

steps:
- name: build
commands:
# TODO use the new DRONE_SEMVER_SHORT environment variables to
# publish docker images for tag events.
- go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
- docker login -u $env:USERNAME -p $env:PASSWORD
- docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
- docker push plugins/docker:windows-1903-amd64
environment:
CGO_ENABLED: "0"
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password

trigger:
event:
- push

depends_on:
- testing
# ---
# kind: pipeline
# type: ssh
# name: windows-1903-amd64-docker

# platform:
# os: windows

# server:
# host: windows.1903.amd64.plugins.drone.ci
# password:
# from_secret: windows_password
# user:
# from_secret: windows_username

# steps:
# - name: build
# commands:
# # TODO use the new DRONE_SEMVER_SHORT environment variables to
# # publish docker images for tag events.
# - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
# - docker login -u $env:USERNAME -p $env:PASSWORD
# - docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
# - docker push plugins/docker:windows-1903-amd64
# environment:
# CGO_ENABLED: "0"
# USERNAME:
# from_secret: docker_username
# PASSWORD:
# from_secret: docker_password

# trigger:
# event:
# - push

# depends_on:
# - testing

---
kind: pipeline
Expand Down Expand Up @@ -441,11 +441,11 @@ trigger:

depends_on:
- windows-1809-amd64-docker
- windows-1903-amd64-docker
- windows-1909-amd64-docker
- linux-amd64-docker
- linux-arm64-docker
- linux-arm-docker
# - windows-1903-amd64-dfocker

---
kind: pipeline
Expand Down
4 changes: 2 additions & 2 deletions cmd/drone-docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func main() {
cli.StringFlag{
Name: "daemon.mirror",
Usage: "docker daemon registry mirror",
EnvVar: "PLUGIN_MIRROR",
EnvVar: "PLUGIN_MIRROR,DOCKER_PLUGIN_MIRROR",
},
cli.StringFlag{
Name: "daemon.storage-driver",
Expand Down Expand Up @@ -216,7 +216,7 @@ func main() {
cli.StringFlag{
Name: "docker.config",
Usage: "docker json dockerconfig content",
EnvVar: "PLUGIN_CONFIG",
EnvVar: "PLUGIN_CONFIG,DOCKER_PLUGIN_CONFIG",
},
cli.BoolTFlag{
Name: "docker.purge",
Expand Down
7 changes: 5 additions & 2 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (p Plugin) Exec() error {
path := filepath.Join(dockerHome, "config.json")
err := ioutil.WriteFile(path, []byte(p.Login.Config), 0600)
if err != nil {
return fmt.Errorf("Error writeing config.json: %s", err)
return fmt.Errorf("Error writing config.json: %s", err)
}
}

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

if _, err := os.Stat("/etc/docker/default.json"); err == nil {
args = append(args, "--seccomp-profile=/etc/docker/default.json")
}

if daemon.StorageDriver != "" {
args = append(args, "-s", daemon.StorageDriver)
}
Expand Down Expand Up @@ -373,7 +377,6 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
return exec.Command(dockerdExe, args...)
}


// helper to check if args match "docker prune"
func isCommandPrune(args []string) bool {
return len(args) > 3 && args[2] == "prune"
Expand Down
9 changes: 9 additions & 0 deletions docker/docker/Dockerfile.linux.arm
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@ FROM arm32v6/docker:19.03.8-dind

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

RUN apk --update add --virtual .build-deps curl && \
mkdir -p /etc/docker/ && \
curl -SsL -o /etc/docker/default.json https://raw.githubusercontent.com/moby/moby/19.03/profiles/seccomp/default.json && \
sed -i 's/SCMP_ACT_ERRNO/SCMP_ACT_TRACE/g' /etc/docker/default.json && \
chmod 600 /etc/docker/default.json && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*

ADD release/linux/arm/drone-docker /bin/
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"]

0 comments on commit 5760e7b

Please sign in to comment.