Improve apk usages in Dockerfile (#1198)

This commit is contained in:
Peter Dave Hello 2023-06-07 15:00:42 +08:00 committed by GitHub
parent 382a1343ea
commit 18f66805cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 13 deletions

View File

@ -1,6 +1,5 @@
FROM node:18-alpine AS builder FROM node:18-alpine AS builder
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER 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 FROM node:18-alpine AS installer
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app WORKDIR /app
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
# First install the dependencies (as they change less often) # First install the dependencies (as they change less often)
@ -48,7 +46,7 @@ ENV DOCKERIZED 1
WORKDIR /code WORKDIR /code
RUN apk --update --no-cache add \ RUN apk --no-cache add \
"libpq~=15" \ "libpq~=15" \
"libxslt~=1.1" \ "libxslt~=1.1" \
"nodejs-current~=19" \ "nodejs-current~=19" \
@ -60,8 +58,8 @@ RUN apk --update --no-cache add \
COPY apiserver/requirements.txt ./ COPY apiserver/requirements.txt ./
COPY apiserver/requirements ./requirements COPY apiserver/requirements ./requirements
RUN apk add libffi-dev RUN apk add --no-cache libffi-dev
RUN apk --update --no-cache --virtual .build-deps add \ RUN apk add --no-cache --virtual .build-deps \
"bash~=5.2" \ "bash~=5.2" \
"g++~=12.2" \ "g++~=12.2" \
"gcc~=12.2" \ "gcc~=12.2" \
@ -82,7 +80,7 @@ COPY apiserver/plane plane/
COPY apiserver/templates templates/ COPY apiserver/templates templates/
COPY apiserver/gunicorn.config.py ./ 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/ COPY apiserver/bin ./bin/
RUN chmod +x ./bin/takeoff ./bin/worker RUN chmod +x ./bin/takeoff ./bin/worker

View File

@ -7,7 +7,7 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /code WORKDIR /code
RUN apk --update --no-cache add \ RUN apk --no-cache add \
"libpq~=15" \ "libpq~=15" \
"libxslt~=1.1" \ "libxslt~=1.1" \
"nodejs-current~=19" \ "nodejs-current~=19" \
@ -15,8 +15,8 @@ RUN apk --update --no-cache add \
COPY requirements.txt ./ COPY requirements.txt ./
COPY requirements ./requirements COPY requirements ./requirements
RUN apk add libffi-dev RUN apk add --no-cache libffi-dev
RUN apk --update --no-cache --virtual .build-deps add \ RUN apk add --no-cache --virtual .build-deps \
"bash~=5.2" \ "bash~=5.2" \
"g++~=12.2" \ "g++~=12.2" \
"gcc~=12.2" \ "gcc~=12.2" \
@ -46,7 +46,7 @@ COPY templates templates/
COPY gunicorn.config.py ./ COPY gunicorn.config.py ./
USER root USER root
RUN apk --update --no-cache add "bash~=5.2" RUN apk --no-cache add "bash~=5.2"
COPY ./bin ./bin/ COPY ./bin ./bin/
RUN chmod +x ./bin/takeoff ./bin/worker RUN chmod +x ./bin/takeoff ./bin/worker

View File

@ -1,6 +1,5 @@
FROM node:18-alpine FROM node:18-alpine
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app

View File

@ -1,6 +1,5 @@
FROM node:18-alpine AS builder FROM node:18-alpine AS builder
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER 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 FROM node:18-alpine AS installer
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app WORKDIR /app
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000