Compare commits

...

3 Commits

Author SHA1 Message Date
Ruben Fiszel
c90d0965a5 all 2024-06-26 19:01:06 +02:00
Ruben Fiszel
2c4c443f75 Merge branch 'main' into rf/extraDocker 2024-06-26 18:36:54 +02:00
Ruben Fiszel
afa73ad6ea all 2024-06-26 17:50:03 +02:00

View File

@@ -23,6 +23,8 @@ ENV SQLX_OFFLINE=true
FROM node:20-alpine as frontend
ARG WITH_DENO=true
# install dependencies
WORKDIR /frontend
COPY ./frontend/package.json ./frontend/package-lock.json ./
@@ -85,12 +87,17 @@ SHELL ["/bin/bash", "-c"]
RUN apt update -y
RUN apt install -y unzip curl
RUN [ "$TARGETPLATFORM" == "linux/amd64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.44.1/deno-x86_64-unknown-linux-gnu.zip -o deno.zip || true
RUN [ "$TARGETPLATFORM" == "linux/arm64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.44.1/deno-aarch64-unknown-linux-gnu.zip -o deno.zip || true
RUN unzip deno.zip && rm deno.zip
ARG BUILD_ENV=copy
# FROM alpine as build_copy
# ONBUILD COPY file /file
# FROM alpine as build_no_copy
# ONBUILD RUN echo "I don't copy"
FROM ${PYTHON_IMAGE}
ARG TARGETPLATFORM
@@ -102,6 +109,10 @@ ARG APP=/usr/src/app
ARG WITH_POWERSHELL=true
ARG WITH_KUBECTL=true
ARG WITH_HELM=true
ARG WITH_GO=true
ARG WITH_BUN=true
ARG WITH_PYTHON=true
RUN apt-get update \
@@ -137,7 +148,8 @@ RUN if [ "$WITH_KUBECTL" = "true" ]; then \
else echo 'Building the image without kubectl'; fi
RUN set -eux; \
RUN if [ "$WITH_GO" = "true" ]; then \
set -eux; \
arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \
case "$arch" in \
'amd64') \
@@ -151,7 +163,8 @@ RUN set -eux; \
;; \
*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
esac; \
wget "https://golang.org/dl/$targz" -nv && tar -C /usr/local -xzf "$targz" && rm "$targz";
wget "https://golang.org/dl/$targz" -nv && tar -C /usr/local -xzf "$targz" && rm "$targz"; \
else echo 'Building the image without go'; fi
ENV PATH="${PATH}:/usr/local/go/bin"
ENV GO_PATH=/usr/local/go/bin/go
@@ -160,7 +173,9 @@ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get -y update && apt-get install -y curl nodejs awscli
# go build is slower the first time it is ran, so we prewarm it in the build
RUN mkdir -p /tmp/gobuildwarm && cd /tmp/gobuildwarm && go mod init gobuildwarm && printf "package foo\nimport (\"fmt\")\nfunc main() { fmt.Println(42) }" > warm.go && go mod tidy && go build -x && rm -rf /tmp/gobuildwarm
RUN if [ "$WITH_GO" = "true" ]; then \
mkdir -p /tmp/gobuildwarm && cd /tmp/gobuildwarm && go mod init gobuildwarm && printf "package foo\nimport (\"fmt\")\nfunc main() { fmt.Println(42) }" > warm.go && go mod tidy && go build -x && rm -rf /tmp/gobuildwarm \
else echo 'Building the image without go'; fi
ENV TZ=Etc/UTC