-
-
Notifications
You must be signed in to change notification settings - Fork 754
/
Copy pathdockerfile
59 lines (49 loc) · 2.3 KB
/
dockerfile
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
# Use the base image specified in the devcontainer.json
FROM mcr.microsoft.com/devcontainers/base:bullseye
# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
apt-transport-https \
curl \
gnupg2 \
lsb-release \
software-properties-common \
openssh-server
# Configure SSH server
RUN mkdir /var/run/sshd \
&& echo 'root:Docker!' | chpasswd \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's@session required pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd \
&& echo "export VISIBLE=now" >> /etc/profile
# Expose SSH port
EXPOSE 22
# Start SSH service
CMD ["/usr/sbin/sshd", "-D"]
# Install .NET SDKs (6, 7, 8 and 9)
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet \
&& ./dotnet-install.sh --channel 7.0 --install-dir /usr/share/dotnet \
&& ./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet \
&& ./dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Install Node.js LTS
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs
# Install Yarn
RUN npm install -g yarn
# Install GitHub CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install -y gh
# Install Azure CLI
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null \
&& AZ_REPO=$(lsb_release -cs) \
&& echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list \
&& apt-get update \
&& apt-get install -y azure-cli
# Clean up
RUN rm dotnet-install.sh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*