diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a161d6aeeaddf8d59f143720307ca8af3650ee0..0a826b61d113d408478bd00e266e42084c741983 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,6 @@ include: "3.24.5": extends: .build_flutter_base variables: - DOCKER_BUILDX_PLATFORMS: linux/amd64 IMAGE_BASENAME: ${IMAGE_PREFIX}/flutter VERSION: 3.24.5 IMAGE_NAME: ${IMAGE_BASENAME}:${VERSION},${IMAGE_BASENAME}:3.24,${IMAGE_BASENAME}:3 diff --git a/.vscode/tasks.json b/.vscode/tasks.json index bc6ca787f9bbf59ed82cfcfbcc20b87e6df4195d..7212c7c93951880ebe7a4ec460f7a4812015df28 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -13,6 +13,20 @@ ".", ], }, + { + "label": "buildx build", + "command": "docker", + "args": [ + "buildx", + "build", + "--build-arg", + "FLUTTER_VERSION=${input:flutterVersion}", + "--platform", + "linux/arm64,linux/amd64", + ".", + ], + }, + ], "inputs": [ { diff --git a/Dockerfile b/Dockerfile index dab5002bd39bf3c1d2894b6a4731b7850bd8d020..f661f8feebccbb127b57bdcf6994fb474b9c18a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,11 +13,23 @@ ARG FLUTTER_DIR="$DEPENDENCY_DIR/${FLUTTER_DIR}" ARG FLUTTER_DOWNLOAD_FILE="flutter.tar.xz" RUN apt update \ - && apt install -y wget xz-utils + && apt install -y wget xz-utils git curl unzip -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 +RUN mkdir -p ${FLUTTER_DIR} + +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + 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; \ + fi + +# Flutter on arch currently has warnings because channel and repository source are not set +RUN if [ "$(uname -m)" = "aarch64" ]; then \ + git clone https://github.com/flutter/flutter.git ${FLUTTER_DIR} \ + && cd ${FLUTTER_DIR} \ + && git fetch origin tag ${FLUTTER_VERSION} \ + && git checkout tags/${FLUTTER_VERSION} \ + && ${FLUTTER_DIR}/bin/flutter doctor; \ + fi FROM alpine:3.20.3