-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from iosis-tech/devcontainer
devcontainer
- Loading branch information
Showing
5 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"mounts": [ | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" | ||
], | ||
"workspaceMount": "type=bind,source=${localWorkspaceFolder},destination=/workshop/sharp-p2p", | ||
"workspaceFolder": "/workshop/sharp-p2p" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Use a Debian-based Linux distribution as the base image | ||
FROM --platform=linux/amd64 debian:stable-slim | ||
|
||
# Install necessary packages for Rust and Python development | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
curl \ | ||
gcc \ | ||
libc6-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Rust using Rustup | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# Add Rust binaries to the PATH | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Display installed Rust version | ||
RUN rustc --version && cargo --version | ||
|
||
# Install cargo-make | ||
RUN cargo install --force cargo-make | ||
|
||
# Install cargo-nextest | ||
RUN curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | ||
|
||
# Install dependencies for Pyenv and Python | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
make \ | ||
build-essential \ | ||
libssl-dev \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
libreadline-dev \ | ||
libsqlite3-dev \ | ||
wget \ | ||
curl \ | ||
llvm \ | ||
libncurses5-dev \ | ||
libncursesw5-dev \ | ||
xz-utils \ | ||
tk-dev \ | ||
libffi-dev \ | ||
liblzma-dev \ | ||
python3-openssl \ | ||
git \ | ||
libgmp-dev \ | ||
libdw1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Pyenv | ||
RUN curl https://pyenv.run | bash | ||
|
||
RUN echo 'export PATH="/root/.pyenv/bin:$PATH"' >> /root/.bashrc && \ | ||
echo 'eval "$(pyenv init -)"' >> /root/.bashrc && \ | ||
echo 'eval "$(pyenv virtualenv-init -)"' >> /root/.bashrc | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Set Pyenv environment variables | ||
ENV PATH="/root/.pyenv/bin:$PATH" | ||
|
||
# Install Python 3.9.0 using Pyenv | ||
RUN eval "$(pyenv init -)" && \ | ||
eval "$(pyenv virtualenv-init -)" && \ | ||
pyenv install 3.9.0 && \ | ||
pyenv global 3.9.0 && \ | ||
pyenv --version && \ | ||
python -V && \ | ||
pip install --upgrade pip | ||
|
||
# Install docker | ||
RUN curl -fsSL https://get.docker.com | bash | ||
|
||
RUN mkdir -p /root/.local/bin | ||
RUN echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.bashrc | ||
|
||
# Set the working directory | ||
WORKDIR /workshop | ||
|
||
# Set the default command to run when the container starts | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[env] | ||
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true | ||
|
||
[tasks.format] | ||
install_crate = "rustfmt" | ||
command = "cargo" | ||
args = ["fmt", "--", "--emit=files"] | ||
|
||
[tasks.clean] | ||
command = "cargo" | ||
args = ["clean"] | ||
|
||
[tasks.build] | ||
command = "cargo" | ||
args = ["build"] | ||
|
||
[tasks.test] | ||
workspace = false | ||
command = "cargo" | ||
args = ["nextest", "run", "--workspace", "${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters