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

Adservice error when building on windows #196

Closed
geoff-maddock opened this issue Mar 16, 2019 · 5 comments
Closed

Adservice error when building on windows #196

geoff-maddock opened this issue Mar 16, 2019 · 5 comments

Comments

@geoff-maddock
Copy link

geoff-maddock commented Mar 16, 2019

This looks related to #128, but I'm running code with the changes mentioned, I'm still seeing an error.

I'm following the instructions to build as per Option 1: Running locally with “Docker for Desktop”

skaffold run

Gets to the step building the Adservice and errors out with:

Building [adservice]...
Sending build context to Docker daemon  106.5kB
Step 1/16 : FROM openjdk:8-slim as builder
 ---> ca76a0748b8a
Step 2/16 : WORKDIR /app
 ---> Using cache
 ---> 864059e8cd26
Step 3/16 : COPY ["build.gradle", "gradlew", "./"]
 ---> Using cache
 ---> 48f29d815557
Step 4/16 : COPY gradlew gradlew
 ---> 55cc63a88dc3
Step 5/16 : RUN chmod +x gradlew
 ---> Running in 7e26c9e7ad17
 ---> 8133454b3890
Step 6/16 : RUN ./gradlew downloadRepos
 ---> Running in a190a32b5a88
/usr/bin/env: ‘sh\r’: No such file or directory
FATA[0018] build failed: building [adservice]: build artifact: The command '/bin/sh -c ./gradlew downloadRepos' returned a non-zero code: 127
@ahmetb
Copy link
Contributor

ahmetb commented Mar 17, 2019

Did you edit the Dockerfile by any chance? Looks like the file has a CRLF ending.

@geoff-maddock
Copy link
Author

I cloned it to my windows machine and ran the skaffold build, so i didn't touch it before I got the error.

@geoff-maddock
Copy link
Author

Got this to work by using this autocrlf parameter when cloning.

git clone https://github.com/GoogleCloudPlatform/microservices-demo.git --config core.autocrlf=input

@ahmetb
Copy link
Contributor

ahmetb commented Mar 19, 2019

I honestly don't know how would this happen.

It sounds like probably ALL cloned dockerfiles would be broken on your machine if that was the case. There are 10 dockerfiles in this repo alone. At any rate, glad to hear you figured out.

@geoff-maddock
Copy link
Author

geoff-maddock commented Mar 19, 2019

It doesn't really make sense to me either why it happened with JUST that dockerfile, but i'm not yet super familiar with this project. In any case, this is documented here now in case any other windows 10 pro users run into a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants