-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (53 loc) · 2.42 KB
/
Dockerfile
File metadata and controls
70 lines (53 loc) · 2.42 KB
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
60
61
62
63
64
65
66
67
68
69
70
# [Choice] Debian / Ubuntu version: debian-12, debian-11, ubuntu-24.04, ubuntu-22.04
# See https://github.com/devcontainers/images/tree/main/src/base-debian
# and https://github.com/devcontainers/images/tree/main/src/base-ubuntu
ARG VARIANT=debian-12
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Set env for tracking that we're running in a devcontainer
ENV DEVCONTAINER=true
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
USER $USERNAME
RUN \
mkdir -p ~/.local/bin \
&& echo "export PATH=\$PATH:~/.local/bin" >> ~/.bashrc
# Configure apt, install packages and general tools
RUN sudo apt-get update \
&& sudo apt-get -y install --no-install-recommends apt-utils dialog nano bash-completion sudo bsdmainutils \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& sudo apt-get -y install git iproute2 procps lsb-release figlet build-essential
# Save command line history
RUN echo "export HISTFILE=/home/$USERNAME/commandhistory/.bash_history" >> "/home/$USERNAME/.bashrc" \
&& echo "export PROMPT_COMMAND='history -a'" >> "/home/$USERNAME/.bashrc" \
&& mkdir -p /home/$USERNAME/commandhistory \
&& touch /home/$USERNAME/commandhistory/.bash_history \
&& chown -R $USERNAME /home/$USERNAME/commandhistory
# Set env for tracking that we're running in a devcontainer
ENV DEVCONTAINER=true
# node
COPY scripts/node.sh /tmp/
RUN /bin/bash /tmp/node.sh 20.x
# docker-client
COPY scripts/docker-client.sh /tmp/
RUN /bin/bash /tmp/docker-client.sh
# Add user to docker group
RUN sudo groupadd docker && sudo usermod -aG docker $USERNAME && newgrp docker
# act
COPY scripts/act.sh /tmp/
RUN /bin/bash /tmp/act.sh 0.2.21
RUN sudo npm install -g tfx-cli
# azure-cli-no-mount
COPY scripts/azure-cli.sh /tmp/
RUN /bin/bash /tmp/azure-cli.sh
RUN az extension add --name azure-devops
# __DEVCONTAINER_SNIPPET_INSERT__ (control where snippets get inserted using the devcontainer CLI)
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog