-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.dev
88 lines (66 loc) · 2.53 KB
/
Dockerfile.dev
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
# Docker container to develop SVSHI, the Secured and Verified Smart Home Infrastructure
# COMMANDS:
# BUILD:
## docker build -t svshi:ubuntu22.04 .
# START AND RUN (execute from `svshi` folder):
## 'docker run --rm -v $PWD:/pwd -d --name svshi -i svshi:ubuntu22.04 && docker exec -it svshi /bin/bash'
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
# Install npm
RUN apt-get update --fix-missing
RUN apt-get install -y nodejs
RUN apt-get update --fix-missing
RUN apt-get install -y --fix-missing npm
RUN npm install -g serve
# Installing basic packages
RUN apt-get update --fix-missing
RUN apt-get install -y apt-utils
RUN apt-get install -y software-properties-common
RUN add-apt-repository universe
RUN apt-get install -y zip
RUN apt-get install -y unzip
RUN apt-get install -y build-essential
RUN apt-get install -y jq
RUN apt-get install -y curl
RUN apt-get install -y wget
RUN apt-get install -y rubygems
RUN apt-get install -y gcc
RUN apt-get install -y gdb
RUN apt-get install -y python3.9
RUN apt-get install -y wget
RUN apt-get install -y git
RUN apt-get install -y nano
RUN apt-get install -y openjdk-11-jdk scala
RUN apt-get install -y sudo
RUN apt-get install -y net-tools
RUN apt-get install apt-transport-https curl gnupg -yqq
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
RUN chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
RUN apt-get update --fix-missing
RUN apt-get install sbt
# To solve issues when running on non-Unix system
RUN apt-get install -y dos2unix
# Install pip3
RUN apt-get install -y python3-distutils
RUN apt-get install -y python3-pip
# Change root's password
RUN echo 'root:nigiri' | chpasswd
# Add non-root user
RUN useradd -rm -d /home/maki -s /bin/bash -g root -G sudo -u 1001 maki
RUN echo 'maki:maki' | chpasswd
RUN chown -R maki /usr/local/lib/node_modules/
RUN chmod -R 775 /usr/local/lib/node_modules/
USER maki
WORKDIR /home/maki
# Install pip3 as maki
RUN pip3 install -U pip
# Update env variables
ENV PATH="/home/maki/.local/lib/python3.9/site-packages:${PATH}"
ENV PATH="/home/maki/.local/bin:${PATH}"
ENV PATH="/home/maki/local/bin:${PATH}"
ENV SVSHI_HOME="/home/maki/svshi_private"
USER maki
EXPOSE 3000
EXPOSE 4242