-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.clang
40 lines (35 loc) · 1.57 KB
/
Dockerfile.clang
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
#
# Dockerfile.ubuntu-dev: General Ubuntu dev eenvironment w/ sudo rights
#
FROM ubuntu:16.04
MAINTAINER John Stultz <[email protected]>
ENV TERM xterm
# Update the image to the lastest updates
RUN apt-get update && apt-get -y dist-upgrade && apt-get clean && apt-get -y autoremove
# Get tools
RUN apt-get update && apt-get install -y \
bc \
gcc \
libncurses5-dev \
make \
python \
git \
libssl-dev \
sudo
# make username a variable, so the script is portable
# add '--build-arg user_name=$USER' to the docker build command
ARG --description="user name for container" user_name=docker
# Add $user_name user
RUN useradd -m $user_name && echo "$user_name:docker" | chpasswd && adduser $user_name sudo
USER $user_name
RUN cd ~/ ; git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
RUN cd ~/ ; git clone --depth=1 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86
RUN echo '#!/bin/bash' > /home/$user_name/env.sh
RUN echo 'export TOOLCHAIN="clang-r349610"' >> /home/$user_name/env.sh
RUN echo 'export C_COMPILER="clang"' >> /home/$user_name/env.sh
RUN echo 'export PATH=${PWD}/aarch64-linux-android-4.9/bin/:${PWD}/linux-x86/${TOOLCHAIN}/bin/:${PATH}' >> /home/$user_name/env.sh
RUN echo 'export CLANG_TRIPLE=aarch64-linux-gnu-' >> /home/$user_name/env.sh
RUN echo 'export CROSS_COMPILE=aarch64-linux-android-' >> /home/$user_name/env.sh
RUN echo 'export ARCH=arm64' >> /home/$user_name/env.sh
RUN echo 'export CC=clang' >> /home/$user_name/env.sh
RUN echo 'export HOSTCC=clang' >> /home/$user_name/env.sh