Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skaffold build fails with COPY target/*.jar /deployments/ on Windows 10 #673

Closed
igdianov opened this issue Jun 11, 2018 · 3 comments
Closed
Labels
kind/bug Something isn't working platform/windows

Comments

@igdianov
Copy link

igdianov commented Jun 11, 2018

Expected behavior

Running skaffold build command should sucesfully build docker container image from Dockerfile containing ADD or COPY target/*.jar /destination instructions with source wildcards.

# Dockerfile
FROM fabric8/java-jboss-openjdk8-jdk:1.2
ENV JAVA_APP_DIR=/deployments

COPY target/*.jar /deployments/

Actual behavior

The build command fails with the error:

$ skaffold build -v debug
INFO[0000] Skaffold &{Version:v0.7.0 GitVersion: GitCommit:71021311d4f4db76044e5fcf8d862bd644744e79 GitTreeState:clean BuildDate:2018-06-07T16:24:34Z GoVersion:go1.10 Compiler:gc Platform:windows/amd64}
INFO[0000] Using kubectl context: minikube
DEBU[0000] Using builder: local
DEBU[0000] Running command: [minikube docker-env --shell none]
DEBU[0000] Command output: stdout DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.99.138:2376
DOCKER_CERT_PATH=C:\Users\Igor\.minikube\certs
DOCKER_API_VERSION=1.23
, stderr:
DEBU[0000] skipPush value not present. defaulting to cluster default true (minikube=true, d4d=true, gke=false)
Starting build...
Found [minikube] context, using local docker daemon.
DEBU[0000] Running docker build: context: ., dockerfile: Dockerfile
DEBU[0000] Checking base image fabric8/java-jboss-openjdk8-jdk:1.2 for ONBUILD triggers.
DEBU[0000] Found onbuild triggers [] in image fabric8/java-jboss-openjdk8-jdk:1.2
INFO[0000] Found dependencies for dockerfile [target/*.jar]
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM fabric8/java-jboss-openjdk8-jdk:1.2
 ---> 2fd9950a1808
Step 2/3 : ENV JAVA_APP_DIR=/deployments
 ---> Using cache
 ---> 7c31edae3fc5
Step 3/3 : COPY target/*.jar /deployments/
FATA[0000] build step: running build for artifact: running build: COPY failed: no source files were specified

Building image with docker image build . command works OK:

$ docker image build .
Sending build context to Docker daemon  54.91MB
Step 1/3 : FROM fabric8/java-jboss-openjdk8-jdk:1.2
 ---> 2fd9950a1808
Step 2/3 : ENV JAVA_APP_DIR=/deployments
 ---> Using cache
 ---> 7c31edae3fc5
Step 3/3 : COPY target/*.jar /deployments/
 ---> Using cache
 ---> 97fa34e00c83
Successfully built 97fa34e00c83

Information

  • Skaffold version: 0.7.0
  • Operating system: Windows 10
  • Shell: GNU bash, version 4.3.42(5)-release (x86_64-pc-msys)
  • Docker version:
Client:                                       
 Version:       18.03.0-ce                    
 API version:   1.23                          
 Go version:    go1.9.4                       
 Git commit:    0520e24302                    
 Built: Fri Mar 23 08:31:36 2018              
 OS/Arch:       windows/amd64                 
 Experimental:  false                         
 Orchestrator:  swarm                         
                                              
Server:                                       
 Engine:                                      
  Version:      17.12.1-ce                    
  API version:  1.35 (minimum version 1.12)   
  Go version:   go1.9.4                       
  Git commit:   7390fc6                       
  Built:        Tue Feb 27 22:20:43 2018      
  OS/Arch:      linux/amd64                   
  Experimental: false                         
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1alpha2
kind: Config
build:
  - imageName: image
    workspace: .
    docker: {}
  local: {}
deploy:
  kubectl:
    manifests:

Steps to reproduce the behavior

  1. Create Dockerfile
FROM fabric8/java-jboss-openjdk8-jdk:1.2
ENV JAVA_APP_DIR=/deployments

COPY target/*.jar /deployments/
  1. run mkdir target && echo app.jar > target/app.jar
  2. run skaffold build

Bug Report

  1. Replace line COPY target/*.jar /deployments/ with COPY target\\app.jar \\deployments\\ in Dockerfile
  2. run skaffold build -v debug will work now. :)
$ DOCKER_CERT_PATH=C:\Users\Igor\.minikube\certs
DOCKER_API_VERSION=1.23
, stderr:
DEBU[0000] skipPush value not present. defaulting to cluster default true (minikube=true, d4d=true, gke=false)
Starting build...
Found [minikube] context, using local docker daemon.
DEBU[0000] Running docker build: context: ., dockerfile: Dockerfile
DEBU[0000] Checking base image fabric8/java-jboss-openjdk8-jdk:1.2 for ONBUILD triggers.
DEBU[0000] Found onbuild triggers [] in image fabric8/java-jboss-openjdk8-jdk:1.2
INFO[0000] Found dependencies for dockerfile [target\app.jar]
Sending build context to Docker daemon  3.072kB
Step 1/3 : FROM fabric8/java-jboss-openjdk8-jdk:1.2
 ---> 2fd9950a1808
Step 2/3 : ENV JAVA_APP_DIR=/deployments
 ---> Using cache
 ---> 7c31edae3fc5
Step 3/3 : COPY target\\app.jar \\deployments\
 ---> Using cache
 ---> b393edadb501
Successfully built b393edadb501
Successfully tagged 7d1aaf620b7d86c787c79ed7cb041ab1:latest
Successfully tagged image:810c4a1-dirty-f9bf0708473a6322
Build complete in 398.8942ms
image -> image:810c4a1-dirty-f9bf0708473a6322
@igdianov igdianov changed the title Skaffold build fails on COPY target/*.jar /deployments/ on Windows 10 Skaffold build fails with COPY target/*.jar /deployments/ on Windows 10 Jun 11, 2018
@r2d4 r2d4 added kind/bug Something isn't working platform/windows labels Jun 12, 2018
@dcherniv
Copy link

@igdianov @r2d4
i believe this is related to my issue
#695
and other older issue:
#442
that was supposed to be fixed by this PR:
#489

It makes sense that it can't find the source because we are passing it unix style separators.
I think it should be fixed with the below PR:
#693

@jguo13
Copy link

jguo13 commented Jun 18, 2018

Yea I was having the same issue and @dcherniv's PR fixed it

@dgageot
Copy link
Contributor

dgageot commented Jun 20, 2018

I assume you also hit that bug: #709

@r2d4 r2d4 closed this as completed Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/windows
Projects
None yet
Development

No branches or pull requests

5 participants