-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathDockerfile
61 lines (44 loc) · 1.72 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
FROM ubuntu:20.04
ARG USERNAME=camper
ARG REPO_NAME=solana-curriculum
ARG HOMEDIR=/workspace/$REPO_NAME
ENV TZ="America/New_York"
ENV HOME=/workspace
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 htop nano
# Install Node LTS
RUN curl -fsSL https://deb.nodesource.com/setup_20.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="/workspace/.cargo/bin:${PATH}"
# Solana
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.17.18/install)"
# RUN wget https://github.com/solana-labs/solana/releases/download/v1.16.9/solana-release-x86_64-unknown-linux-gnu.tar.bz2
# RUN tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
# RUN cd solana-release/
# ENV PATH="$PWD/bin:${PATH}"
# /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'
RUN npm install -g yarn @coral-xyz/anchor-cli@0.30.0
# Configure course-specific environment
COPY . .
WORKDIR ${HOMEDIR}
RUN cd ${HOMEDIR} && npm install
# wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb
# sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb