mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 10:10:39 +00:00
commit
8971a82c08
@ -2,8 +2,8 @@
|
|||||||
#
|
#
|
||||||
# docker build --rm=true -t plugins/docker .
|
# docker build --rm=true -t plugins/docker .
|
||||||
|
|
||||||
FROM rancher/docker:v1.10.2
|
FROM docker:1.11-dind
|
||||||
|
|
||||||
ADD drone-docker /usr/bin/
|
ADD drone-docker /bin/
|
||||||
VOLUME /var/lib/docker
|
|
||||||
ENTRYPOINT ["/usr/bin/dockerlaunch", "/usr/bin/drone-docker"]
|
ENTRYPOINT ["/bin/drone-docker"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# drone-git
|
# drone-docker
|
||||||
|
|
||||||
Drone plugin can be used to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
|
Drone plugin can be used to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -40,7 +40,7 @@ func main() {
|
|||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "daemon.mirror",
|
Name: "daemon.mirror",
|
||||||
Usage: "docker daemon registry mirror",
|
Usage: "docker daemon registry mirror",
|
||||||
EnvVar: "PLUGIN_REGISTRY",
|
EnvVar: "PLUGIN_MIRROR",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "daemon.storage-driver",
|
Name: "daemon.storage-driver",
|
||||||
|
16
plugin.go
16
plugin.go
@ -119,10 +119,12 @@ func (p Plugin) Exec() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dockerExe = "/usr/local/bin/docker"
|
||||||
|
|
||||||
// helper function to create the docker login command.
|
// helper function to create the docker login command.
|
||||||
func commandLogin(login Login) *exec.Cmd {
|
func commandLogin(login Login) *exec.Cmd {
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
"/usr/bin/docker", "login",
|
dockerExe, "login",
|
||||||
"-u", login.Username,
|
"-u", login.Username,
|
||||||
"-p", login.Password,
|
"-p", login.Password,
|
||||||
"-e", login.Email,
|
"-e", login.Email,
|
||||||
@ -132,18 +134,18 @@ func commandLogin(login Login) *exec.Cmd {
|
|||||||
|
|
||||||
// helper function to create the docker info command.
|
// helper function to create the docker info command.
|
||||||
func commandVersion() *exec.Cmd {
|
func commandVersion() *exec.Cmd {
|
||||||
return exec.Command("/usr/bin/docker", "version")
|
return exec.Command(dockerExe, "version")
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to create the docker info command.
|
// helper function to create the docker info command.
|
||||||
func commandInfo() *exec.Cmd {
|
func commandInfo() *exec.Cmd {
|
||||||
return exec.Command("/usr/bin/docker", "info")
|
return exec.Command(dockerExe, "info")
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to create the docker build command.
|
// helper function to create the docker build command.
|
||||||
func commandBuild(build Build) *exec.Cmd {
|
func commandBuild(build Build) *exec.Cmd {
|
||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
"/usr/bin/docker", "build",
|
dockerExe, "build",
|
||||||
"--pull=true",
|
"--pull=true",
|
||||||
"--rm=true",
|
"--rm=true",
|
||||||
"-f", build.Dockerfile,
|
"-f", build.Dockerfile,
|
||||||
@ -163,14 +165,14 @@ func commandTag(build Build, tag string) *exec.Cmd {
|
|||||||
target = fmt.Sprintf("%s:%s", build.Repo, tag)
|
target = fmt.Sprintf("%s:%s", build.Repo, tag)
|
||||||
)
|
)
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
"/usr/bin/docker", "tag", source, target,
|
dockerExe, "tag", source, target,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to create the docker push command.
|
// helper function to create the docker push command.
|
||||||
func commandPush(build Build, tag string) *exec.Cmd {
|
func commandPush(build Build, tag string) *exec.Cmd {
|
||||||
target := fmt.Sprintf("%s:%s", build.Repo, tag)
|
target := fmt.Sprintf("%s:%s", build.Repo, tag)
|
||||||
return exec.Command("/usr/bin/docker", "push", target)
|
return exec.Command(dockerExe, "push", target)
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to create the docker daemon command.
|
// helper function to create the docker daemon command.
|
||||||
@ -192,7 +194,7 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
|
|||||||
for _, dns := range daemon.DNS {
|
for _, dns := range daemon.DNS {
|
||||||
args = append(args, "--dns", dns)
|
args = append(args, "--dns", dns)
|
||||||
}
|
}
|
||||||
return exec.Command("/usr/bin/docker", args...)
|
return exec.Command(dockerExe, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// trace writes each command to stdout with the command wrapped in an xml
|
// trace writes each command to stdout with the command wrapped in an xml
|
||||||
|
Loading…
Reference in New Issue
Block a user