Compare commits

...

4 Commits

Author SHA1 Message Date
Shubham Agrawal ee562a4a1b Fix kaniko-gcr docker file 2020-11-26 23:47:00 +05:30
Shubham Agrawal e200b5c566 Merge pull request #4 from drone/v2_registry
fix docker v2 registry issue
2020-11-26 16:32:29 +05:30
Shubham Agrawal 2c637d285e fix docker v2 registry issue 2020-11-26 16:29:05 +05:30
Shubham Agrawal 4be32f2451 Merge pull request #3 from drone/fix_build_script
fix build script
2020-11-26 11:47:54 +05:30
6 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ Build the Docker images with the following commands:
docker build \
--label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
--file docker/docker/Dockerfile.linux.amd64 --tag plugins/kaniko-docker .
--file docker/docker/Dockerfile.linux.amd64 --tag plugins/kaniko .
docker build \
--label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
+10 -1
View File
@@ -18,6 +18,9 @@ const (
// Docker file path
dockerPath string = "/kaniko/.docker"
dockerConfigPath string = "/kaniko/.docker/config.json"
v1Registry string = "https://index.docker.io/v1/" // Default registry
v2Registry string = "https://index.docker.io/v2/" // v2 registry is not supported
)
var (
@@ -78,7 +81,7 @@ func main() {
cli.StringFlag{
Name: "registry",
Usage: "docker registry",
Value: "https://index.docker.io/v1/",
Value: v1Registry,
EnvVar: "PLUGIN_REGISTRY",
},
cli.StringFlag{
@@ -130,6 +133,12 @@ func createDockerCfgFile(username, password, registry string) error {
return fmt.Errorf("Registry must be specified")
}
if registry == v2Registry {
fmt.Println("Docker v2 registry is not supported in kaniko. Refer issue: https://github.com/GoogleContainerTools/kaniko/issues/1209")
fmt.Printf("Using v1 registry instead: %s\n", v1Registry)
registry = v1Registry
}
err := os.MkdirAll(dockerPath, 0600)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("failed to create %s directory", dockerPath))
+1 -1
View File
@@ -15,7 +15,7 @@ import (
const (
// GCR JSON key file path
gcrKeyPath string = "/kaniko/gcr.json"
gcrKeyPath string = "/kaniko/config.json"
gcrEnvVariable string = "GOOGLE_APPLICATION_CREDENTIALS"
)
+1 -4
View File
@@ -1,7 +1,4 @@
FROM gcr.io/kaniko-project/executor:amd64-v1.3.0
ENV HOME /root
ENV USER root
FROM gcr.io/kaniko-project/executor:v1.3.0
ADD release/linux/amd64/kaniko-docker /kaniko/
ENTRYPOINT ["/kaniko/kaniko-docker"]
+1 -4
View File
@@ -1,7 +1,4 @@
FROM gcr.io/kaniko-project/executor:amd64-v1.3.0
ENV HOME /root
ENV USER root
FROM gcr.io/kaniko-project/executor:v1.3.0
ADD release/linux/amd64/kaniko-ecr /kaniko/
ENTRYPOINT ["/kaniko/kaniko-ecr"]
+1 -4
View File
@@ -1,7 +1,4 @@
FROM gcr.io/kaniko-project/executor:amd64-v1.3.0
ENV HOME /root
ENV USER root
FROM gcr.io/kaniko-project/executor:v1.3.0
ADD release/linux/amd64/kaniko-gcr /kaniko/
ENTRYPOINT ["/kaniko/kaniko-gcr"]