forked from RudolfGeosits/MSP430-Emulator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
57 lines (47 loc) · 1.38 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
#-----------------#
# MSP430 Emulator #
#-----------------#
FROM ubuntu:19.10
# Meta
LABEL PROJECT_NAME="MSP430 Emulator"
LABEL PROJECT_CODE="MSPEMU"
LABEL VENDOR="Public"
LABEL ARTEFACT="MSP430 emulator"
LABEL DESCRIPTION="MSP430 emulator forked from github.com/RudolsGeosits/MSP430-Emulator and improved for use in CI"
LABEL LICENSE="GPLv3"
# Variables (not part of the container ENV)
ARG USER_NAME=msp
ARG HOME_DIR=/home/${USER_NAME}
ARG WORK_DIR=${HOME_DIR}/msp430-emulator
# Support for old Ubuntu version
RUN sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
# Basic utilities
RUN apt-get update && apt-get install -y \
g++ \
gcc-msp430 \
libreadline-dev \
libssl-dev \
libwebsockets-dev \
make \
msp430mcu \
msp430-libc
# Directory setup
ENV HOME=${HOME_DIR}
RUN mkdir -p ${HOME_DIR} && \
mkdir -p ${WORK_DIR}
ENV PATH=${PATH}:${WORK_DIR}
WORKDIR ${WORK_DIR}
# Sources (not moved into src folder to preserve compatibility with the parent repository)
# COPY dir behaves as cp dir/*, therefore directories need to be copied separately
# 430x2_firm is not needed
COPY debugger ${WORK_DIR}/debugger
COPY devices ${WORK_DIR}/devices
COPY test ${WORK_DIR}/test
COPY Makefile \
main.cpp \
main.h \
${WORK_DIR}/
# Build
RUN make -C ${WORK_DIR} all
# Test
RUN make -C ${WORK_DIR} test