DEV Community

ivolkoff
ivolkoff

Posted on

Speed docker build up the build by 10X times for frontend applications

I'm developing on macOS, and my Kubernetes cluster is on linux.


The configuration before was:

Dockerfile:

FROM node:14.17-alpine as a builder
...
FROM nginx
...
Enter fullscreen mode Exit fullscreen mode

I ran the command:

docker build --platform linux/amd64 -t fe-spa:latest .
Enter fullscreen mode Exit fullscreen mode

The assembly began to take 20 minutes


I changed the configuration and started doing this:

Dockerfile:

FROM node:14.17-alpine as a builder
...
FROM --platform linux/amd64 nginx
...
Enter fullscreen mode Exit fullscreen mode

I ran the command:

docker build -t fe-spa:latest .
Enter fullscreen mode Exit fullscreen mode

The assembly began to take 2 minutes


the transfer of the platform selection allowed us to get an increase in speed

Top comments (0)