From 18f66805cb4b10b78d0b71c8fa65602f48efae4f Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Wed, 7 Jun 2023 15:00:42 +0800 Subject: [PATCH] Improve apk usages in Dockerfile (#1198) --- Dockerfile | 10 ++++------ apiserver/Dockerfile.api | 8 ++++---- apps/app/Dockerfile.dev | 1 - apps/app/Dockerfile.web | 2 -- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0610aab1c..5cff15dc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM node:18-alpine AS builder RUN apk add --no-cache libc6-compat -RUN apk update # Set working directory WORKDIR /app ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER @@ -14,7 +13,6 @@ RUN turbo prune --scope=app --docker FROM node:18-alpine AS installer RUN apk add --no-cache libc6-compat -RUN apk update WORKDIR /app ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 # First install the dependencies (as they change less often) @@ -48,7 +46,7 @@ ENV DOCKERIZED 1 WORKDIR /code -RUN apk --update --no-cache add \ +RUN apk --no-cache add \ "libpq~=15" \ "libxslt~=1.1" \ "nodejs-current~=19" \ @@ -60,8 +58,8 @@ RUN apk --update --no-cache add \ COPY apiserver/requirements.txt ./ COPY apiserver/requirements ./requirements -RUN apk add libffi-dev -RUN apk --update --no-cache --virtual .build-deps add \ +RUN apk add --no-cache libffi-dev +RUN apk add --no-cache --virtual .build-deps \ "bash~=5.2" \ "g++~=12.2" \ "gcc~=12.2" \ @@ -82,7 +80,7 @@ COPY apiserver/plane plane/ COPY apiserver/templates templates/ COPY apiserver/gunicorn.config.py ./ -RUN apk --update --no-cache add "bash~=5.2" +RUN apk --no-cache add "bash~=5.2" COPY apiserver/bin ./bin/ RUN chmod +x ./bin/takeoff ./bin/worker diff --git a/apiserver/Dockerfile.api b/apiserver/Dockerfile.api index 123544571..402940f83 100644 --- a/apiserver/Dockerfile.api +++ b/apiserver/Dockerfile.api @@ -7,7 +7,7 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1 WORKDIR /code -RUN apk --update --no-cache add \ +RUN apk --no-cache add \ "libpq~=15" \ "libxslt~=1.1" \ "nodejs-current~=19" \ @@ -15,8 +15,8 @@ RUN apk --update --no-cache add \ COPY requirements.txt ./ COPY requirements ./requirements -RUN apk add libffi-dev -RUN apk --update --no-cache --virtual .build-deps add \ +RUN apk add --no-cache libffi-dev +RUN apk add --no-cache --virtual .build-deps \ "bash~=5.2" \ "g++~=12.2" \ "gcc~=12.2" \ @@ -46,7 +46,7 @@ COPY templates templates/ COPY gunicorn.config.py ./ USER root -RUN apk --update --no-cache add "bash~=5.2" +RUN apk --no-cache add "bash~=5.2" COPY ./bin ./bin/ RUN chmod +x ./bin/takeoff ./bin/worker diff --git a/apps/app/Dockerfile.dev b/apps/app/Dockerfile.dev index 7b802634c..d4281c9a3 100644 --- a/apps/app/Dockerfile.dev +++ b/apps/app/Dockerfile.dev @@ -1,6 +1,5 @@ FROM node:18-alpine RUN apk add --no-cache libc6-compat -RUN apk update # Set working directory WORKDIR /app diff --git a/apps/app/Dockerfile.web b/apps/app/Dockerfile.web index 0b3e45f7a..1b9bc41d5 100644 --- a/apps/app/Dockerfile.web +++ b/apps/app/Dockerfile.web @@ -1,6 +1,5 @@ FROM node:18-alpine AS builder RUN apk add --no-cache libc6-compat -RUN apk update # Set working directory WORKDIR /app ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER @@ -14,7 +13,6 @@ RUN turbo prune --scope=app --docker FROM node:18-alpine AS installer RUN apk add --no-cache libc6-compat -RUN apk update WORKDIR /app ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000