help me write dockerfile for flutter with archlinux as a base
- User
help me write dockerfile for flutter with archlinux as a base
- Assistant
Sure! Here's a basic Dockerfile for building a Flutter app with Archlinux as the base image:
# Use Archlinux as the base image FROM archlinux # Install required dependencies RUN pacman -Syu --noconfirm \ base-devel \ git \ sudo \ wget \ unzip \ zip \ xorg-server-xvfb \ lib32-gcc-libs \ lib32-glibc \ lib32-libstdc++5 \ lib32-zlib # Set up environment variables ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 # Set up Flutter SDK environment variables ENV FLUTTER_HOME /usr/local/flutter ENV FLUTTER_VERSION beta # Download and install Flutter SDK RUN git clone https://github.com/flutter/flutter.git ${FLUTTER_HOME} ENV PATH ${FLUTTER_HOME}/bin:${PATH} # Accept Flutter licenses RUN flutter --version RUN flutter doctor --android-licenses # Enable Flutter web support RUN flutter channel dev RUN flutter upgrade RUN flutter config --enable-web # Create and set the workdir WORKDIR /app # Copy the Flutter app source code and install dependencies COPY . /app RUN flutter packages get # Build the Flutter app RUN flutter build web # Expose the default Flutter web server port (optional) EXPOSE 5000 # Start the Flutter web server CMD ["flutter", "run", "--release", "-d", "web-server", "--web-port", "5000"]