Merge branch 'master' into revert-243-revert-242-appendtags

This commit is contained in:
Thomas Boerger 2019-09-17 21:39:32 +02:00 committed by GitHub
commit 1672823733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 152 additions and 977 deletions

View File

@ -1,33 +0,0 @@
local pipeline = import 'pipeline.libsonnet';
[
pipeline.test('windows', 'amd64', '1803'),
pipeline.build('docker', 'windows', 'amd64', '1803'),
pipeline.build('docker', 'windows', 'amd64', '1809'),
pipeline.notifications('docker', 'windows', 'amd64', '1809', [
'windows-1803',
'windows-1809'
]),
pipeline.build('gcr', 'windows', 'amd64', '1803'),
pipeline.build('gcr', 'windows', 'amd64', '1809'),
pipeline.notifications('gcr', 'windows', 'amd64', '1809', [
'windows-1803',
'windows-1809'
]),
pipeline.build('acr', 'windows', 'amd64', '1803'),
pipeline.build('acr', 'windows', 'amd64', '1809'),
pipeline.notifications('acr', 'windows', 'amd64', '1809', [
'windows-1803',
'windows-1809'
]),
pipeline.build('ecr', 'windows', 'amd64', '1803'),
pipeline.build('ecr', 'windows', 'amd64', '1809'),
pipeline.notifications('ecr', 'windows', 'amd64', '1809', [
'windows-1803',
'windows-1809'
]),
]

View File

@ -1,926 +0,0 @@
---
kind: pipeline
name: testing
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: vet
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- go vet ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
- name: test
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- go test -cover ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
---
kind: pipeline
name: windows-1803-docker
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: executable
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- ./release/windows/amd64/drone-docker.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-1803
settings:
daemon_off: true
dockerfile: docker/docker/Dockerfile.windows.1803
dry_run: true
password:
from_secret: docker_password
repo: plugins/docker
tags: windows-1803
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1803
settings:
auto_tag: true
auto_tag_suffix: windows-1803
daemon_off: true
dockerfile: docker/docker/Dockerfile.windows.1803
password:
from_secret: docker_password
repo: plugins/docker
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
---
kind: pipeline
name: windows-1809-docker
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: executable
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- ./release/windows/amd64/drone-docker.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-1809
settings:
daemon_off: true
dockerfile: docker/docker/Dockerfile.windows.1809
dry_run: true
password:
from_secret: docker_password
repo: plugins/docker
tags: windows-1809
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1809
settings:
auto_tag: true
auto_tag_suffix: windows-1809
daemon_off: true
dockerfile: docker/docker/Dockerfile.windows.1809
password:
from_secret: docker_password
repo: plugins/docker
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
---
kind: pipeline
name: notifications-docker
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/docker/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
urls:
from_secret: microbadger_docker
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- windows-1803-docker
- windows-1809-docker
---
kind: pipeline
name: windows-1803-gcr
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1803
settings:
daemon_off: true
dockerfile: docker/gcr/Dockerfile.windows.1803
dry_run: true
password:
from_secret: docker_password
repo: plugins/gcr
tags: windows-1803
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1803
settings:
auto_tag: true
auto_tag_suffix: windows-1803
daemon_off: true
dockerfile: docker/gcr/Dockerfile.windows.1803
password:
from_secret: docker_password
repo: plugins/gcr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1803-docker
---
kind: pipeline
name: windows-1809-gcr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1809
settings:
daemon_off: true
dockerfile: docker/gcr/Dockerfile.windows.1809
dry_run: true
password:
from_secret: docker_password
repo: plugins/gcr
tags: windows-1809
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1809
settings:
auto_tag: true
auto_tag_suffix: windows-1809
daemon_off: true
dockerfile: docker/gcr/Dockerfile.windows.1809
password:
from_secret: docker_password
repo: plugins/gcr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1809-docker
---
kind: pipeline
name: notifications-gcr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/gcr/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
urls:
from_secret: microbadger_gcr
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- windows-1803-gcr
- windows-1809-gcr
---
kind: pipeline
name: windows-1803-ecr
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1803
settings:
daemon_off: true
dockerfile: docker/ecr/Dockerfile.windows.1803
dry_run: true
password:
from_secret: docker_password
repo: plugins/ecr
tags: windows-1803
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1803
settings:
auto_tag: true
auto_tag_suffix: windows-1803
daemon_off: true
dockerfile: docker/ecr/Dockerfile.windows.1803
password:
from_secret: docker_password
repo: plugins/ecr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1803-docker
---
kind: pipeline
name: windows-1809-ecr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1809
settings:
daemon_off: true
dockerfile: docker/ecr/Dockerfile.windows.1809
dry_run: true
password:
from_secret: docker_password
repo: plugins/ecr
tags: windows-1809
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1809
settings:
auto_tag: true
auto_tag_suffix: windows-1809
daemon_off: true
dockerfile: docker/ecr/Dockerfile.windows.1809
password:
from_secret: docker_password
repo: plugins/ecr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1809-docker
---
kind: pipeline
name: notifications-ecr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/ecr/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
urls:
from_secret: microbadger_ecr
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- windows-1803-ecr
- windows-1809-ecr
---
kind: pipeline
name: windows-1803-acr
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1803
settings:
daemon_off: true
dockerfile: docker/acr/Dockerfile.windows.1803
dry_run: true
password:
from_secret: docker_password
repo: plugins/acr
tags: windows-1803
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1803
settings:
auto_tag: true
auto_tag_suffix: windows-1803
daemon_off: true
dockerfile: docker/acr/Dockerfile.windows.1803
password:
from_secret: docker_password
repo: plugins/acr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1803-docker
---
kind: pipeline
name: windows-1809-acr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:windows-1809
settings:
daemon_off: true
dockerfile: docker/acr/Dockerfile.windows.1809
dry_run: true
password:
from_secret: docker_password
repo: plugins/acr
tags: windows-1809
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1809
settings:
auto_tag: true
auto_tag_suffix: windows-1809
daemon_off: true
dockerfile: docker/acr/Dockerfile.windows.1809
password:
from_secret: docker_password
repo: plugins/acr
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- windows-1809-docker
---
kind: pipeline
name: notifications-acr
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: docker/acr/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
url:
from_secret: microbadger_acr
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- windows-1803-acr
- windows-1809-acr
...

View File

@ -39,6 +39,82 @@ trigger:
- "refs/tags/**"
- "refs/pull/**"
---
kind: pipeline
type: ssh
name: windows-1809-amd64-docker
platform:
os: windows
server:
host: windows.1809.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.1809 -t plugins/docker:windows-1809-amd64 .
- docker push plugins/docker:windows-1809-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
name: linux-amd64-docker
@ -326,6 +402,8 @@ trigger:
- "refs/tags/**"
depends_on:
- windows-1809-amd64-docker
- windows-1903-amd64-docker
- linux-amd64-docker
- linux-arm64-docker
- linux-arm-docker

26
daemon.go Normal file
View File

@ -0,0 +1,26 @@
// +build !windows
package docker
import (
"io/ioutil"
"os"
)
const dockerExe = "/usr/local/bin/docker"
const dockerdExe = "/usr/local/bin/dockerd"
func (p Plugin) startDaemon() {
cmd := commandDaemon(p.Daemon)
if p.Daemon.Debug {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = ioutil.Discard
cmd.Stderr = ioutil.Discard
}
go func() {
trace(cmd)
cmd.Run()
}()
}

10
daemon_win.go Normal file
View File

@ -0,0 +1,10 @@
// +build windows
package docker
const dockerExe = "C:\\bin\\docker.exe"
const dockerdExe = ""
func (p Plugin) startDaemon() {
// this is a no-op on windows
}

View File

@ -2,7 +2,6 @@ package docker
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
@ -69,18 +68,7 @@ type (
func (p Plugin) Exec() error {
// start the Docker daemon server
if !p.Daemon.Disabled {
cmd := commandDaemon(p.Daemon)
if p.Daemon.Debug {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = ioutil.Discard
cmd.Stderr = ioutil.Discard
}
go func() {
trace(cmd)
cmd.Run()
}()
p.startDaemon()
}
// poll the docker daemon until it is started. This ensures the daemon is
@ -154,9 +142,6 @@ func (p Plugin) Exec() error {
return nil
}
const dockerExe = "/usr/local/bin/docker"
const dockerdExe = "/usr/local/bin/dockerd"
// helper function to create the docker login command.
func commandLogin(login Login) *exec.Cmd {
if login.Email != "" {

View File

@ -13,7 +13,8 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Invoke-WebRequest $('https://github.com/docker/toolbox/releases/download/v{0}/DockerToolbox-{0}.exe' -f $env:DOCKER_VERSION) -OutFile 'dockertoolbox.exe' -UseBasicParsing
RUN /innoextract.exe dockertoolbox.exe
FROM plugins/base:windows-1809
FROM mcr.microsoft.com/windows/nanoserver:1809
USER ContainerAdministrator
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Docker" `

View File

@ -0,0 +1,28 @@
# escape=`
FROM mcr.microsoft.com/windows/servercore:1903 as download
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV DOCKER_VERSION 19.03.1
RUN Invoke-WebRequest 'http://constexpr.org/innoextract/files/innoextract-1.7-windows.zip' -OutFile 'innoextract.zip' -UseBasicParsing ; `
Expand-Archive innoextract.zip -DestinationPath C:\ ; `
Remove-Item -Path innoextract.zip
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
Invoke-WebRequest $('https://github.com/docker/toolbox/releases/download/v{0}/DockerToolbox-{0}.exe' -f $env:DOCKER_VERSION) -OutFile 'dockertoolbox.exe' -UseBasicParsing
RUN /innoextract.exe dockertoolbox.exe
FROM mcr.microsoft.com/windows/nanoserver:1903
USER ContainerAdministrator
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Docker" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
RUN mkdir C:\bin
COPY --from=download /windows/system32/netapi32.dll /windows/system32/netapi32.dll
COPY --from=download /app/docker.exe C:/bin/docker.exe
ADD release/windows/amd64/drone-docker.exe C:/bin/drone-docker.exe
ENTRYPOINT [ "C:\\bin\\drone-docker.exe" ]

View File

@ -30,8 +30,14 @@ manifests:
os: windows
version: 1803
-
image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809
image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
version: 1809
-
image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64
platform:
architecture: amd64
os: windows
version: 1903