This repository was archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
103 lines (93 loc) · 3.24 KB
/
Dockerfile
File metadata and controls
103 lines (93 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
ARG UBUNTU_VERSION=
FROM ubuntu:${UBUNTU_VERSION}
LABEL org.opencontainers.image.source https://github.com/sambyeol/flutter-devcontainer
ARG ANDROID_SDK_TOOLS_VERSION=
ARG ANDROID_PLATFORM_VERSION=
ARG ANDROID_BUILD_TOOLS_VERSION=
ARG FLUTTER_VERSION=
# basic tools for development
USER root
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
clang \
cmake \
curl \
git \
language-pack-en \
libgtk-3-dev \
ninja-build \
pkg-config \
ssh-client \
sudo \
unzip \
wget \
zip \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
# non-root user
RUN useradd \
--shell $(which bash) \
-G sudo \
-m -d /home/sambyeol \
sambyeol \
&& sed -i -e 's/%sudo.*/%sudo\tALL=(ALL:ALL)\tNOPASSWD:ALL/g' /etc/sudoers \
&& touch /home/sambyeol/.sudo_as_admin_successful
USER sambyeol
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" \
&& sed -i -e 's/OSH_THEME=.*/OSH_THEME="simple"/g' /home/sambyeol/.bashrc
# install android sdk
ENV ANDROID_HOME=/opt/android-sdk-linux
ENV ANDROID_SDK_ROOT=$ANDROID_HOME
ENV PATH=${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator:${PATH}
ENV ANDROID_SDK_TOOLS_VERSION=${ANDROID_SDK_TOOLS_VERSION}
ENV ANDROID_PLATFORM_VERSION=${ANDROID_PLATFORM_VERSION}
ENV ANDROID_BUILD_TOOLS_VERSION=${ANDROID_BUILD_TOOLS_VERSION}
USER root
RUN chmod 777 /opt
WORKDIR /opt
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bc \
build-essential \
lcov \
libglu1-mesa \
libpulse0 \
libsqlite3-0 \
libstdc++6 \
locales \
openjdk-11-jdk \
ruby-bundler \
ruby-full \
software-properties-common \
# for x86 emulators
libasound2 \
libatk-bridge2.0-0 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3-dev \
libxss1 \
libxtst6 \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
USER sambyeol
RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip -O android-sdk-tools.zip \
&& mkdir -p ${ANDROID_HOME}/cmdline-tools/ \
&& unzip android-sdk-tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
&& rm android-sdk-tools.zip \
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
&& yes | sdkmanager --licenses \
&& yes | sdkmanager platform-tools \
&& yes | sdkmanager \
"platforms;android-$ANDROID_PLATFORM_VERSION" \
"build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
&& sdkmanager emulator
# install flutter
ENV FLUTTER_HOME=/opt/flutter
ENV FLUTTER_VERSION=${FLUTTER_VERSION}
ENV FLUTTER_ROOT=$FLUTTER_HOME
ENV PATH ${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin:${PATH}
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
&& yes | flutter doctor --android-licenses \
&& flutter config --enable-web
WORKDIR /workspaces