-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathDockerfile
51 lines (36 loc) · 1.26 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
FROM ubuntu:20.04
ARG USERNAME=camper
ARG REPO_NAME=web3-curriculum
ARG HOMEDIR=/workspace/$REPO_NAME
ENV TZ="America/New_York"
RUN apt-get update && apt-get install -y sudo
# Unminimize Ubuntu to restore man pages
RUN yes | unminimize
# Set up timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set up user, disable pw, and add to sudo group
RUN adduser --disabled-password \
--gecos '' ${USERNAME}
RUN adduser ${USERNAME} sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \
/etc/sudoers
# Install packages for projects
RUN sudo apt-get install -y curl git bash-completion man-db firefox
# Install Node LTS
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
RUN sudo apt-get install -y nodejs
# Rust
RUN sudo apt-get install -y build-essential
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# wasm-pack
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# /usr/lib/node_modules is owned by root, so this creates a folder ${USERNAME}
# can use for npm install --global
WORKDIR ${HOMEDIR}
RUN mkdir ~/.npm-global
RUN npm config set prefix '~/.npm-global'
# Configure course-specific environment
COPY . .
WORKDIR ${HOMEDIR}
RUN cd ${HOMEDIR} && npm install