redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Docker image size growth (investigation)

Open adamaltman opened this issue 3 years ago • 2 comments

Investigate the cause:

Image size has jumped from 132 MB to 361 MB since changing to FROM redocly/openapi-cli:v1.0.0-beta.75

adamaltman avatar Dec 29 '21 14:12 adamaltman

The smaller image size was using:

FROM node:16.13.1-alpine3.14
RUN apk update && \
    apk add bash jq && \
    rm -rf /var/cache/apk
RUN npm install -g --update-notifier=false @redocly/[email protected]
...

This issue was reported due to the increase in my image size from 132 MB TO 361 MG after changing to FROM redocly/openapi-cli:v1.0.0-beta.75. I don't have a history on the uncompressed image size of redocly/openapi-cli itself.

# docker image ls
REPOSITORY              TAG         IMAGE ID       CREATED         SIZE
ab_redocly              latest      ee2a92c66851   4 days ago      364MB
redocly/openapi-cli     latest      aa4698b5a5c8   5 days ago      361MB
<none>                  <none>      a26001519df7   5 days ago      135MB

<none> represents my final build of ab_redocly that was based on node:16.13.1-alpine3.14.

mikebd avatar Dec 29 '21 15:12 mikebd

I believe we need to use a multi-stage build for our docker image.

RomanHotsiy avatar Dec 29 '21 16:12 RomanHotsiy

The size is now reporting as 501MB so definitely needs looking at.

lornajane avatar Apr 03 '23 07:04 lornajane