@@ -7,9 +7,17 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7
7
python3-pip \
8
8
git \
9
9
curl \
10
+ fish \
10
11
&& apt-get clean \
11
12
&& rm -rf /var/lib/apt/lists/*
12
13
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
+
13
21
# Install arduino-cli
14
22
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
15
23
@@ -22,16 +30,16 @@ ENV PATH="/usr/local/bin:${PATH}"
22
30
# Create workspace directory
23
31
WORKDIR /workspace
24
32
25
- # Copy arduino-cli configuration
33
+ # Copy arduino-cli configuration (customise to your actual path)
26
34
COPY arduino-cli.yaml /root/.arduino15/arduino-cli.yaml
27
35
28
36
# 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/*
30
38
31
- # Install Arduino cores for ESP8266 and ESP32
39
+ # (Optional) Install Arduino cores for ESP8266 and ESP32 if needed
32
40
RUN arduino-cli core install esp8266:esp8266 esp32:esp32
33
41
34
- # Install only required dependencies for DallasTemperature library
42
+ # Install only required dependencies for DallasTemperature library and others
35
43
RUN arduino-cli lib install \
36
44
"OneWire" \
37
45
"ArduinoUnit" # For testing
@@ -43,13 +51,27 @@ RUN arduino-cli lib list
43
51
COPY update-libraries.sh /usr/local/bin/
44
52
RUN chmod +x /usr/local/bin/update-libraries.sh
45
53
46
- # Add aliases for build operations
54
+ # Add aliases for build operations (for Bash)
47
55
RUN echo 'alias arduino-build="./build.sh build"' >> /home/vscode/.bashrc && \
48
56
echo 'alias arduino-test="./build.sh test"' >> /home/vscode/.bashrc && \
49
57
echo 'alias arduino-build-test="./build.sh all"' >> /home/vscode/.bashrc
50
58
51
- # Add welcome message to .bashrc
59
+ # Add a welcome message to .bashrc
52
60
RUN echo '\n # Welcome to the dev container! Here are some useful aliases:' >> /home/vscode/.bashrc && \
53
61
echo 'echo " - arduino-build: Build the project"' >> /home/vscode/.bashrc && \
54
62
echo 'echo " - arduino-test: Run tests for the project"' >> /home/vscode/.bashrc && \
55
63
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