-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.devcontainer
59 lines (43 loc) · 2.29 KB
/
Dockerfile.devcontainer
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
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT=3-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="16"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# install mcfly as root
RUN curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly
USER vscode
# Shell customizations
# 1) Install and configure starship.rs prompt
RUN curl -fsSL https://starship.rs/install.sh | sh -s -- --yes
RUN echo "eval \"\$(starship init bash)\"" >> ~/.bashrc && echo "eval \"\$(starship init zsh)\"" >> ~/.zshrc
RUN mkdir -p /home/vscode/.config/
COPY starship.toml /home/vscode/.config/starship.toml
# 2) install thefuck
RUN pip3 install thefuck --user \
&& echo 'eval "$(thefuck --alias)"' >> ~/.bashrc \
&& echo 'eval "$(thefuck --alias)"' >> ~/.zshrc
# 3) install mcfly config
RUN echo 'eval "$(mcfly init zsh)"' >> ~/.zshrc \
&& touch ~/.zsh_history
# Install brownie & other devtools
# COPY requirements.txt /tmp/pip-tmp/
RUN wget https://raw.githubusercontent.com/eth-brownie/brownie/master/requirements.txt -O /tmp/pip-requirements.txt
RUN pip install -r /tmp/pip-requirements.txt
RUN pip install eth-brownie
COPY prepare_environment.sh .
RUN ./prepare_environment.sh
# [Optional] Uncomment this line to install global node packages.
RUN npm install -g solhint prettier prettier-plugin-solidity solhint-plugin-prettier
# Create dummy project and compile it to cache dependencies
RUN mkdir -p /tmp/brownie-setup
WORKDIR /tmp/brownie-setup
COPY brownie-config.yaml .
RUN /home/vscode/.local/bin/brownie init dummy \
&& cd dummy \
&& cp ../brownie-config.yaml . \
&& /home/vscode/.local/bin/brownie compile --all
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
WORKDIR /workspace