-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
72 lines (61 loc) · 2.1 KB
/
Dockerfile
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
# Start with Ubuntu 18.04
FROM ubuntu:18.04
# Add ARG variables to be used only in the build
ARG BUILD_INFO=/build-info.txt
# ARMGCC is ADDed from a web url, the file is decompressed + extracted based on a wildcard matching pattern, and the name of the resulting directory must be added to the path
ARG ARMGCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
ARG ARMGCC_DWNLD_MATCH=gcc-arm-none-eabi*.tar.bz2
ARG ARMGCC_VERSION=gcc-arm-none-eabi-10-2020-q4-major
ARG ARMGCC_PATH="/bin/${ARMGCC_VERSION}/bin"
# Create a build log
RUN touch ${BUILD_INFO} && \
echo "Build created on: " >> ${BUILD_INFO} && \
date >> ${BUILD_INFO} && \
echo "" >> ${BUILD_INFO}
# Install necessary apt packages
RUN echo "Installing Packages" && \
apt-get update -y && \
apt-get install -y --no-install-recommends \
build-essential \
jq \
git \
mercurial \
zip \
wget \
curl \
unzip \
# python-pip \
# python-dev \
# python-setuptools \
python3-pip \
python3-dev \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/* && \
echo "" >> ${BUILD_INFO}
RUN echo "Installed packages: " >> ${BUILD_INFO} && \
make --version | head -n 1 >> ${BUILD_INFO} && \
git --version >> ${BUILD_INFO} && \
which wget >> ${BUILD_INFO} && \
curl --version | head -n 1 >> ${BUILD_INFO} && \
which zip >> ${BUILD_INFO} && \
which unzip >> ${BUILD_INFO} && \
# python --version >> ${BUILD_INFO} && \
# pip --version >> ${BUILD_INFO} && \
python3 --version >> ${BUILD_INFO} && \
pip3 --version >> ${BUILD_INFO} && \
echo "" >> ${BUILD_INFO}
# Install ARM Embedded Toolchain
ADD ${ARMGCC_URL} /tmp/
RUN echo "Installing ARM Cross Compiler" && \
tar -xvjf /tmp/${ARMGCC_DWNLD_MATCH} -C /bin/ && \
rm -rf /tmp/* && \
echo ""
ENV PATH="${ARMGCC_PATH}:${PATH}"
# Install mbed-cli
RUN echo "Installing mbed-cli" && \
pip3 install mbed-cli && \
echo "mbed-cli $(mbed --version)" >> ${BUILD_INFO}
ENV MBED_GCC_ARM_PATH="${ARMGCC_PATH}"
# Set up entry point for github action
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]