Cannot build docker image on EC2
See original GitHub issueDescribe the bug I have successfully built docker image at my local device. However, Building it on EC2 Linux instance will always report the following error:
Building datahub-frontend-react
[+] Building 132.0s (12/15)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.94kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 35B 0.0s
=> [internal] load metadata for docker.io/library/node:16.13.0-alpine3.14 0.9s
=> [internal] load metadata for docker.io/library/alpine:3.14 0.6s
=> [prod-build 1/4] FROM docker.io/library/node:16.13.0-alpine3.14@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0e 2.6s
=> => resolve docker.io/library/node:16.13.0-alpine3.14@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b 0.0s
=> => sha256:784cd1fd612b7ef9870aa1d85ca7285010993bc089f1a00ae1dcd6644074a398 34.81MB / 34.81MB 0.8s
=> => sha256:0ec5d186b713b05c9f9ebb40df5c7c3f3b67133a2effbf3e3215756220136363 2.35MB / 2.35MB 0.3s
=> => sha256:98dc27ad6276f18e415689e0d39332e7cac56ed95b678093f61193bb0bd9db01 451B / 451B 0.3s
=> => sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b 1.43kB / 1.43kB 0.0s
=> => sha256:5277c7d171e02ee76417bb290ef488aa80e4e64572119eec0cb9fffbcffb8f6a 1.16kB / 1.16kB 0.0s
=> => sha256:44e24535dfbf4b537a7ac13e92c524712c3226af52c0e1037eba7415c16a5828 6.53kB / 6.53kB 0.0s
=> => extracting sha256:784cd1fd612b7ef9870aa1d85ca7285010993bc089f1a00ae1dcd6644074a398 1.4s
=> => extracting sha256:0ec5d186b713b05c9f9ebb40df5c7c3f3b67133a2effbf3e3215756220136363 0.1s
=> => extracting sha256:98dc27ad6276f18e415689e0d39332e7cac56ed95b678093f61193bb0bd9db01 0.0s
=> CACHED [base 1/3] FROM docker.io/library/alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 379.86kB 0.3s
=> [base 2/3] RUN addgroup -S datahub && adduser -S datahub -G datahub 0.7s
=> [base 3/3] RUN apk --no-cache --update-cache --available upgrade && apk --no-cache add curl openjdk8-jre 6.0s
=> [prod-build 2/4] RUN apk --no-cache --update-cache --available upgrade && apk --no-cache add perl openjdk8 4.9s
=> [prod-build 3/4] COPY . datahub-src 4.4s
=> ERROR [prod-build 4/4] RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableEmber=false -PuseSystemNode=true -x test -x 119.1s
------
> [prod-build 4/4] RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableEmber=false -PuseSystemNode=true -x test -x yarnTest -x yarnLint && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip:
#12 0.508 Downloading https://services.gradle.org/distributions/gradle-6.9.2-bin.zip
#12 1.480 ......................................................................................................
#12 3.807
#12 3.808 Welcome to Gradle 6.9.2!
#12 3.809
#12 3.809 Here are the highlights of this release:
#12 3.809 - This is a small backport release.
#12 3.810 - Java 16 can be used to compile when used with Java toolchains
#12 3.810 - Dynamic versions can be used within plugin declarations
#12 3.811 - Native support for Apple Silicon processors
#12 3.811
#12 3.812 For more details see https://docs.gradle.org/6.9.2/release-notes.html
#12 3.812
#12 6.706 Configuration on demand is an incubating feature.
#12 55.81
#12 55.81 > Configure project :metadata-integration:java:datahub-client
#12 55.81 In else section
#12 58.31
#12 58.31 > Configure project :metadata-integration:java:spark-lineage
#12 58.31 In else section
#12 105.9 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
#12 105.9 SLF4J: Defaulting to no-operation (NOP) logger implementation
#12 105.9 SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
#12 106.6
#12 106.6 > Task :datahub-web-react:nodeSetup SKIPPED
#12 107.5
#12 107.5 > Task :datahub-web-react:yarnSetup
#12 107.5
#12 107.5 added 1 package, and audited 2 packages in 548ms
#12 107.5
#12 107.5 found 0 vulnerabilities
#12 109.5
#12 109.5 > Task :datahub-web-react:yarnInstall
#12 109.5 yarn install v1.22.15
#12 109.5 [1/4] Resolving packages...
#12 109.5 [2/4] Fetching packages...
#12 116.2
#12 116.2 > Task :datahub-web-react:yarnInstall FAILED
#12 117.0 > Task :datahub-frontend:compilePlayBinaryPlayRoutes
#12 117.0
#12 117.0 FAILURE: Build failed with an exception.
#12 117.0
#12 117.0 * What went wrong:
#12 117.0 Execution failed for task ':datahub-web-react:yarnInstall'.
#12 117.0 > Process 'command 'yarn'' finished with non-zero exit value 131
#12 117.0
#12 117.0 * Try:
#12 117.0 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
#12 117.0
#12 117.0 * Get more help at https://help.gradle.org
#12 117.0
#12 117.0
#12 117.0 BUILD FAILED in 1m 56s
#12 117.0 Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
#12 117.0 Use '--warning-mode all' to show the individual deprecation warnings.
#12 117.0 See https://docs.gradle.org/6.9.2/userguide/command_line_interface.html#sec:command_line_warnings
#12 117.0 3 actionable tasks: 3 executed
------
executor failed running [/bin/sh -c cd datahub-src && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM_NODE} -x test -x yarnTest -x yarnLint && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip]: exit code: 1
ERROR: Service 'datahub-frontend-react' failed to build : Build failed
To Reproduce
Steps to reproduce the behavior:
After clone the repo. go to /datahub/docker, and run COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build
Expected behavior What should I do to unblock the deployment on EC2?
Desktop (please complete the following information):
- OS: Amazon Linux 2
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
Build and Deploy Docker Images to AWS using EC2 Image ...
In this post, we walk through the process of building a Docker image and deploying the image to Amazon ECR, share some security...
Read more >Docker ubuntu build fails on ec2 - Stack Overflow
Running this on the ec2 instance works but I cannot run it inside the Dockerfile script (because the ubuntu does not come with...
Read more >Docker-machine executor can't build docker image
Hello all! I'm a happy user of this Terraform module: GitHub - npalm/terraform-aws-gitlab-runner: Terraform module for AWS GitLab runners on ec ...
Read more >Deploying Docker containers on ECS - Docker Documentation
To pull private images from another registry, including Docker Hub, you'll have to create a Username + Password (or a Username + Token)...
Read more >[Backend #27] Auto build & push docker image to AWS ECR ...
... build and push docker images to AWS Elastic Container Registry using Github Actions. ... Your browser can't play this video.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
get the same error through a local build
This issue was closed because it has been inactive for 30 days since being marked as stale.