Skip to content

Commit cf3f36c

Browse files
committed
Trial 1
1 parent 15aab20 commit cf3f36c

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Docker
17+
uses: docker/setup-buildx-action@v1
18+
19+
- name: Build Docker Image
20+
run: |
21+
docker build -t android-studio .

.gitpod.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
github:
2+
prebuilds:
3+
pullRequestsFromForks: true
4+
addComment: true
5+
addBadge: true
6+
addLabel: prebuilt-in-gitpod
7+
8+
checkoutLocation: work
9+
workspaceLocation: /
10+
image:
11+
file: Dockerfile
12+
ports:
13+
- port: 6080
14+
protocol: "http"
15+
tasks:
16+
# - command: "go get -v ./... && go run main.go"
17+
- command: "echo hi"

Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM gitpod/workspace-full-vnc@sha256:331a933c3bce7d7cb3e78f8cfac93ae706091575758adeba3a86072d585e52b0
2+
3+
ARG ANDROID_STUDIO_URL=https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2023.1.1.28/android-studio-2023.1.1.28-linux.tar.gz
4+
ARG ANDROID_STUDIO_VERSION=2023.1.1
5+
6+
USER root
7+
8+
# Install dependencies
9+
RUN dpkg --add-architecture i386 && \
10+
apt-get update && \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
12+
coreutils \
13+
curl \
14+
expect \
15+
lib32gcc1 \
16+
lib32ncurses5-dev \
17+
lib32stdc++6 \
18+
lib32z1 \
19+
libc6-i386 \
20+
pv \
21+
unzip \
22+
wget && \
23+
apt-get clean && \
24+
rm -rf /var/cache/apt/* && \
25+
rm -rf /var/lib/apt/lists/* && \
26+
rm -rf /tmp/* && \
27+
rm -rf /var/tmp/*
28+
29+
RUN \
30+
wget -O /opt/android-studio-ide.tar.gz $ANDROID_STUDIO_URL && \
31+
export sha="$(sha256sum /opt/android-studio-ide.tar.gz)" ; \
32+
if [ "$sha" != "139d0dbb4909353b68fbf55c09b6d31a34512044a9d4f02ce0f1a9accca128f9 /opt/android-studio-ide.tar.gz" ]; then \
33+
echo "SHA-256 Checksum mismatch, aborting installation"; \
34+
rm -f /opt/android-studio-ide.tar.gz; exit 1; \
35+
else \
36+
cd /opt && tar xf android-studio-ide.tar.gz && rm android-studio-ide.tar.gz; \
37+
fi
38+
39+
# fix display resolution
40+
RUN \
41+
sed -i 's/1920x1080/1280x720/' /usr/bin/start-vnc-session.sh
42+
43+
USER gitpod
44+
45+
RUN \
46+
mkdir -p $HOME/.local/bin && \
47+
printf '\nPATH=$HOME/.local/bin:$PATH\n' | \
48+
tee -a /home/gitpod/.bashrc && \
49+
ln -s /opt/android-studio/bin/studio.sh \
50+
/home/gitpod/.local/bin/android_studio && \
51+
: "if running locally (vs using gitpod in cloud) need to create /workspace " && \
52+
sudo mkdir -p /workspace/.gradle && \
53+
sudo chown -R gitpod:gitpod /workspace
54+
55+
ARG ANDROID_INSTALLATION_URL=https://github.com/phlummox/android-studio-docker/releases/download/v0.1/android-studio-installation.tar.xz
56+
57+
RUN \
58+
cd $HOME && \
59+
wget -O - $ANDROID_INSTALLATION_URL | tar x --xz

0 commit comments

Comments
 (0)