Initial commit: expo-popcore project
This commit is contained in:
126
.devcontainer/Dockerfile
Normal file
126
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,126 @@
|
||||
# Ubuntu 20.04 from GitHub mirror
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL maintainer="vitor.roberto3022@gmail.com"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Use Alibaba Cloud mirror for Ubuntu packages
|
||||
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
|
||||
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
|
||||
|
||||
# Update the package list and install dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
curl \
|
||||
gnupg \
|
||||
wget \
|
||||
unzip \
|
||||
make \
|
||||
sudo \
|
||||
git \
|
||||
build-essential
|
||||
|
||||
# Add NodeSource APT repository for Node.js (keep for compatibility)
|
||||
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
|
||||
|
||||
# Install Node.js (include for some tools that still require it)
|
||||
RUN apt-get install -y nodejs
|
||||
|
||||
# Install Bun using official installation script
|
||||
RUN curl -fsSL https://bun.sh/install | bash
|
||||
|
||||
# Set Bun environment variables (official installation location)
|
||||
ENV BUN_INSTALL="/root/.bun"
|
||||
ENV PATH="$BUN_INSTALL/bin:$PATH"
|
||||
|
||||
# Install expo dependencies with Bun
|
||||
RUN bun install -g eas-cli
|
||||
RUN bun install -g sharp-cli
|
||||
|
||||
# Setup folder to store the expo apps
|
||||
RUN mkdir -p /home/expo_apps/
|
||||
|
||||
# Install android studio and java dependencies
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libc6:i386 \
|
||||
libncurses5:i386 \
|
||||
libstdc++6:i386 \
|
||||
lib32z1 \
|
||||
libbz2-1.0:i386 \
|
||||
libxrender1 \
|
||||
libxtst6 \
|
||||
libxi6 \
|
||||
libfreetype6 \
|
||||
libxft2 \
|
||||
xz-utils \
|
||||
qemu \
|
||||
qemu-kvm \
|
||||
libvirt-daemon-system \
|
||||
libvirt-clients \
|
||||
bridge-utils \
|
||||
libnotify4 \
|
||||
libglu1-mesa \
|
||||
libqt5widgets5 \
|
||||
openjdk-17-jdk \
|
||||
xvfb
|
||||
|
||||
# Get Android SDK command line tools from official Google source
|
||||
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
|
||||
RUN unzip commandlinetools-linux-11076708_latest.zip
|
||||
RUN mkdir -p /android-sdk-linux/cmdline-tools
|
||||
RUN mv cmdline-tools /android-sdk-linux/cmdline-tools/latest
|
||||
|
||||
# Get NDK version 27.1.12297006 from official Google source
|
||||
RUN wget https://dl.google.com/android/repository/android-ndk-r27-linux.zip
|
||||
RUN unzip android-ndk-r27-linux.zip
|
||||
|
||||
# Set environment variables
|
||||
ENV ANDROID_HOME=/android-sdk-linux
|
||||
ENV ANDROID_SDK_ROOT=/android-sdk-linux
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||
ENV ANDROID_NDK_HOME=/android-ndk-r27
|
||||
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
|
||||
|
||||
# Accept Android SDK licenses
|
||||
RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
|
||||
|
||||
# Install required Android SDK components for minSDK 24, targetSDK 36
|
||||
RUN $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
|
||||
"platform-tools" \
|
||||
"platforms;android-36" \
|
||||
"platforms;android-24" \
|
||||
"build-tools;36.0.0" \
|
||||
"build-tools;24.0.3"
|
||||
|
||||
# Create workspace directory
|
||||
WORKDIR /workspace
|
||||
|
||||
# Configure Gradle for better performance
|
||||
RUN mkdir -p ~/.gradle
|
||||
RUN echo 'org.gradle.daemon=true' >> ~/.gradle/gradle.properties
|
||||
RUN echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties
|
||||
RUN echo 'org.gradle.configureondemand=true' >> ~/.gradle/gradle.properties
|
||||
|
||||
# Set environment variables for root user
|
||||
ENV ANDROID_HOME=/android-sdk-linux
|
||||
ENV ANDROID_SDK_ROOT=/android-sdk-linux
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||
ENV ANDROID_NDK_HOME=/android-ndk-r27
|
||||
ENV BUN_INSTALL="/root/.bun"
|
||||
ENV PATH="$BUN_INSTALL/bin:$JAVA_HOME/bin:$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools"
|
||||
|
||||
# Verify installations
|
||||
RUN java -version
|
||||
RUN node --version
|
||||
RUN npm --version
|
||||
RUN bun --version
|
||||
RUN eas --version
|
||||
RUN $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list
|
||||
|
||||
# Expose default ports
|
||||
EXPOSE 8081 19000 19001 19002
|
||||
|
||||
# Default command
|
||||
CMD ["sleep", "infinity"]
|
||||
Reference in New Issue
Block a user