@@ -7,9 +7,17 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
77 python3-pip \
88 git \
99 curl \
10+ fish \
1011 && apt-get clean \
1112 && rm -rf /var/lib/apt/lists/*
1213
14+ RUN mkdir -p /home/vscode/.local/share/CMakeTools \
15+ && chown -R vscode:vscode /home/vscode/.local/share/CMakeTools
16+
17+ RUN mkdir -p /home/vscode/.ssh \
18+ && chown vscode:vscode /home/vscode/.ssh \
19+ && chmod 700 /home/vscode/.ssh
20+
1321# Install arduino-cli
1422RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
1523
@@ -22,16 +30,16 @@ ENV PATH="/usr/local/bin:${PATH}"
2230# Create workspace directory
2331WORKDIR /workspace
2432
25- # Copy arduino-cli configuration
33+ # Copy arduino-cli configuration (customise to your actual path)
2634COPY arduino-cli.yaml /root/.arduino15/arduino-cli.yaml
2735
2836# Install build essentials
29- RUN apt-get update && apt-get install -y build-essential
37+ RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
3038
31- # Install Arduino cores for ESP8266 and ESP32
39+ # (Optional) Install Arduino cores for ESP8266 and ESP32 if needed
3240RUN arduino-cli core install esp8266:esp8266 esp32:esp32
3341
34- # Install only required dependencies for DallasTemperature library
42+ # Install only required dependencies for DallasTemperature library and others
3543RUN arduino-cli lib install \
3644 "OneWire" \
3745 "ArduinoUnit" # For testing
@@ -43,13 +51,27 @@ RUN arduino-cli lib list
4351COPY update-libraries.sh /usr/local/bin/
4452RUN chmod +x /usr/local/bin/update-libraries.sh
4553
46- # Add aliases for build operations
54+ # Add aliases for build operations (for Bash)
4755RUN echo 'alias arduino-build="./build.sh build"' >> /home/vscode/.bashrc && \
4856 echo 'alias arduino-test="./build.sh test"' >> /home/vscode/.bashrc && \
4957 echo 'alias arduino-build-test="./build.sh all"' >> /home/vscode/.bashrc
5058
51- # Add welcome message to .bashrc
59+ # Add a welcome message to .bashrc
5260RUN echo '\n # Welcome to the dev container! Here are some useful aliases:' >> /home/vscode/.bashrc && \
5361 echo 'echo " - arduino-build: Build the project"' >> /home/vscode/.bashrc && \
5462 echo 'echo " - arduino-test: Run tests for the project"' >> /home/vscode/.bashrc && \
5563 echo 'echo " - arduino-build-test: Build and test the project"' >> /home/vscode/.bashrc
64+
65+ # (Optional) Add fish-specific configuration if desired
66+ # For example, you might add an alias file or welcome message for fish:
67+ RUN mkdir -p /home/vscode/.config/fish && \
68+ echo 'set -gx PATH /usr/local/bin $PATH' >> /home/vscode/.config/fish/config.fish && \
69+ echo '# Welcome to the Fish shell inside the dev container!' >> /home/vscode/.config/fish/config.fish
70+
71+ # Generate SSH keys and set proper ownership and permissions
72+ RUN if [ ! -f /home/vscode/.ssh/id_rsa ]; then \
73+ ssh-keygen -t rsa -b 4096 -N "" -C "devcontainer@local" -f /home/vscode/.ssh/id_rsa && \
74+ chmod 600 /home/vscode/.ssh/id_rsa && \
75+ chmod 644 /home/vscode/.ssh/id_rsa.pub && \
76+ chown vscode:vscode /home/vscode/.ssh/id_rsa /home/vscode/.ssh/id_rsa.pub ; \
77+ fi
0 commit comments