diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 575572f00d7b68db6db67c62b4cedd65fea4647c..4565e2694c1c5798001cefe7993de09c47979ce9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,11 @@ include: - project: docker-images/templates ref: master - file: images.gitlab-ci.yml + file: docker_hub.gitlab-ci.yml build: extends: .build_image_job_template variables: DOCKER_BUILDX_PLATFORMS: linux/amd64 - IMAGE_NAME: $IMAGE_SERVER/flutter:3.24.0 + IMAGE_BASENAME: ${IMAGE_PREFIX}/flutter + IMAGE_NAME: ${IMAGE_BASENAME}:3.24.5,${IMAGE_BASENAME}:3.24,${IMAGE_BASENAME}:3 diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000000000000000000000000000000000..ed4a0aa21642c7e53f0de3c9b673e112c636cc8a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "docker build", + "command": "docker", + "args": [ + "build", + "." + ] + } + ] +} diff --git a/Dockerfile b/Dockerfile index 26c27f965db85eb2ebd8720e0da0d422410579c0..9799530f2f533331899e4bf94c89a26a0bbedd20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,45 @@ ARG IMAGE_SERVER="registry.420joos.dev" -ARG FLUTTER_VERSION="3.24.0" +ARG FLUTTER_VERSION="3.24.5" ARG DEPENDENCY_DIR="/tmp/dependencies" -ARG FLUTTER_URL="https://github.com/flutter/flutter" -FROM $IMAGE_SERVER/ubuntu:22.04 AS download +FROM ubuntu:24.04 AS download ARG FLUTTER_URL ARG FLUTTER_VERSION ARG DEPENDENCY_DIR ARG FLUTTER_DIR="$DEPENDENCY_DIR/flutter" -ARG TMP_DEPENDENCIES_DIR="$DEPENDENCY_DIR/tmp" -ARG GLIBC_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1" +ARG FLUTTER_DOWNLOAD_FILE="flutter.tar.xz" RUN apt update \ - && apt install -y wget git \ - && git clone -b $FLUTTER_VERSION --depth 1 "${FLUTTER_URL}.git" $FLUTTER_DIR \ - && cd $FLUTTER_DIR \ - && git gc --prune=all \ - # && wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz \ - # && tar xf flutter_linux_${FLUTTER_VERSION}-stable.tar.xz --strip-components=1 --directory $FLUTTER_DIR \ - && wget "$GLIBC_URL/glibc-2.35-r1.apk" --directory-prefix $TMP_DEPENDENCIES_DIR \ - && wget "$GLIBC_URL/glibc-bin-2.35-r1.apk" --directory-prefix $TMP_DEPENDENCIES_DIR + && apt install -y wget xz-utils +RUN mkdir -p ${FLUTTER_DIR} \ + && wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz -O ${FLUTTER_DOWNLOAD_FILE} \ + && tar -xf ${FLUTTER_DOWNLOAD_FILE} --strip-components=1 --directory $FLUTTER_DIR -FROM alpine:3.20 + +FROM alpine:3.20.3 ARG DEPENDENCY_DIR +ARG USER_UID="1000" +ARG USER_GID=${USER_UID} +ARG USERNAME="flutter" ENV FLUTTER_HOME="/flutter" ENV PATH=$PATH:$FLUTTER_HOME/bin -ENV FLUTTER_GIT_URL="unknown source" COPY --from=download $DEPENDENCY_DIR / -RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ - && apk add --no-cache --force-overwrite curl bash git tmp/glibc-2.35-r1.apk tmp/glibc-bin-2.35-r1.apk \ - && rm -r /tmp/* \ - && dart --disable-analytics && flutter config --no-analytics \ +RUN apk add --no-cache bash git gcompat \ + && addgroup ${USERNAME} -g ${USER_GID} \ + && adduser ${USERNAME} --uid ${USER_UID} --ingroup ${USERNAME} --disabled-password \ + && chown -R ${USERNAME}:${USERNAME} ${FLUTTER_HOME} + +USER ${USERNAME} +WORKDIR /home/${USERNAME} + +RUN dart --disable-analytics && flutter config --no-analytics \ && flutter precache --universal + +# Test flutter +# RUN flutter doctor --verbose && exit 1