Skip to content

Commit

Permalink
docker in docker and missing deps fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Apr 24, 2024
1 parent c19a9df commit 4d59155
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"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"
}
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ RUN apt-get update && \
curl \
gcc \
libc6-dev \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# Install Rust using Rustup
Expand Down Expand Up @@ -41,25 +39,32 @@ RUN apt-get update && \
liblzma-dev \
python3-openssl \
git \
libgmp-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Pyenv
RUN curl https://pyenv.run | bash

# Set Pyenv environment variables
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PATH"

RUN echo 'export PATH="/root/.pyenv/bin:$PATH"' >> /root/.bashrc && \
echo 'eval "$(pyenv init -)"' >> /root/.bashrc && \
echo 'eval "$(pyenv virtualenv-init -)"' >> /root/.bashrc

# Reload bash
RUN bash -c 'exec $SHELL'
SHELL ["/bin/bash", "-c"]

# Set Pyenv environment variables
ENV PATH="/root/.pyenv/bin:$PATH"

# Install Python 3.9.0 using Pyenv
RUN bash -c 'pyenv install 3.9.0' && \
bash -c 'pyenv global 3.9.0'
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

# Set the working directory
WORKDIR /workshop
Expand Down
5 changes: 2 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import subprocess

from colorama import Fore, Style

def log_and_run(commands, description, cwd=None):
from colorama import Fore, Style

full_command = " && ".join(commands)
try:
print(f"{Fore.YELLOW}Starting: {description}...{Style.RESET_ALL}")
Expand All @@ -19,7 +19,6 @@ def log_and_run(commands, description, cwd=None):

if __name__ == "__main__":
subprocess.run(["pip", "install", "-r", "requirements.txt"], check=True)
from colorama import Fore, Style

log_and_run(["pip install cairo/"], "Install bootloader package", cwd=".")

Expand Down

0 comments on commit 4d59155

Please sign in to comment.