Skip to content

Commit

Permalink
Add FLUTTER_VERSION argument
Browse files Browse the repository at this point in the history
  • Loading branch information
nullskill committed Jul 5, 2024
1 parent fd2b043 commit ebafdb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,27 @@ jobs:
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Build and push

- name: Read Flutter version
id: read_version
run: echo "FLUTTER_VERSION=$(cat flutter_current_version.txt)" >> $GITHUB_OUTPUT

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: nullskill/openvscode-server-flutter:latest
build-args: |
FLUTTER_VERSION=${{ steps.read_version.outputs.FLUTTER_VERSION }}
23 changes: 10 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
FROM gitpod/openvscode-server:latest

ARG VERSION="stable"
ARG FLUTTER_HOME="/opt/flutter"
ARG PUB_CACHE="/var/tmp/.pub_cache"
ARG FLUTTER_VERSION="3.22.1"
ARG FLUTTER_ARCHIVE="flutter_linux_${FLUTTER_VERSION}-stable.tar.xz"
ARG FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/${FLUTTER_ARCHIVE}"

FROM gitpod/openvscode-server:latest

USER root
WORKDIR /
ARG FLUTTER_VERSION
ENV FLUTTER_VERSION=${FLUTTER_VERSION:-3.22.1}

ARG VERSION
ARG FLUTTER_HOME
ARG PUB_CACHE
ARG FLUTTER_ARCHIVE
ARG FLUTTER_URL
RUN echo "Building with Flutter version: $FLUTTER_VERSION"

ENV FLUTTER_ARCHIVE="flutter_linux_${FLUTTER_VERSION}-stable.tar.xz"
ENV FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/${FLUTTER_ARCHIVE}"
ENV VERSION=$VERSION \
FLUTTER_HOME=$FLUTTER_HOME \
FLUTTER_ROOT=$FLUTTER_HOME \
Expand All @@ -24,6 +18,9 @@ ENV VERSION=$VERSION \
OPENVSCODE_SERVER_ROOT="/home/.openvscode-server" \
OPENVSCODE="${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server"

USER root
WORKDIR /

# Install prerequisites
RUN echo "Installing prerequisites..."
RUN apt-get update
Expand Down

0 comments on commit ebafdb9

Please sign in to comment.