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

Issue building Java11 Gradle hello-world image #2744

Closed
bryceitoc9 opened this issue Mar 19, 2021 · 1 comment
Closed

Issue building Java11 Gradle hello-world image #2744

bryceitoc9 opened this issue Mar 19, 2021 · 1 comment
Labels

Comments

@bryceitoc9
Copy link

Description:

sam build on a Java11 Gradle image hello-world app fails. This is affecting me on Windows 10, unsure if it affects other OSes. Definitely does not affect a similar Maven image.

Steps to reproduce:

  • sam init a Java11 Gradle image hello-world app
  • cd sam-app
  • sam build

Observed result:

PS C:\Users\xxxxx\testApps\javamavenonly\lambda-java11\sam-app> sam build
Building codeuri: C:\Users\xxxxx\testApps\javamavenonly\lambda-java11\sam-app runtime: None metadata: {'DockerTag': 'java11-gradle-v1', 'DockerContext': 'C:\\Users\\xxxxx\\testApps\\javamavenonly\\lambda-java11\\sam-app\\HelloWorldFunction', 'Dockerfile': 'Dockerfile'} functions: ['HelloWorldFunction']
Building image for HelloWorldFunction function
Setting DockerBuildArgs: {} for HelloWorldFunction function
 ---> 65a02b57e7e1
Step 2/16 : ARG SCRATCH_DIR=/var/task/build
 ---> Using cache
 ---> d09ff3bbb8a7
Step 3/16 : COPY src/ src/
 ---> Using cache
 ---> 4618bee4ba1a
Step 4/16 : COPY gradle/ gradle/
 ---> Using cache
 ---> 3f26f691faf9
Step 5/16 : COPY build.gradle gradlew ./
 ---> Using cache
 ---> 71a4b474ed5b
Step 6/16 : RUN mkdir build
 ---> Using cache
 ---> 44d57749f6b4
Step 7/16 : COPY gradle/lambda-build-init.gradle ./build
 ---> Using cache
 ---> a8d10ca5504b
Step 8/16 : RUN ./gradlew --project-cache-dir $SCRATCH_DIR/gradle-cache -Dsoftware.amazon.aws.lambdabuilders.scratch-dir=$SCRATCH_DIR --init-script $SCRATCH_DIR/lambda-build-init.gradle build
 ---> Running in 9e61aa3d1056
: No such file or directory

Build Failed
Error: HelloWorldFunction failed to build: The command '/bin/sh -c ./gradlew --project-cache-dir $SCRATCH_DIR/gradle-cache -Dsoftware.amazon.aws.lambdabuilders.scratch-dir=$SCRATCH_DIR --init-script $SCRATCH_DIR/lambda-build-init.gradle build' returned a non-zero code: 127

Expected result:

Successfully built SAM app

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Windows 10
  2. sam --version: SAM CLI, version 1.21.1
  3. AWS region: N/A
    Add --debug flag to command you are running
@CoshUS
Copy link
Contributor

CoshUS commented Mar 22, 2021

Closing. Duplicate of #2551
PR to address this issue: #2738

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

No branches or pull requests

2 participants