-
Notifications
You must be signed in to change notification settings - Fork 908
Expand file tree
/
Copy pathDockerfile
More file actions
116 lines (106 loc) · 4.67 KB
/
Dockerfile
File metadata and controls
116 lines (106 loc) · 4.67 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
FROM ubuntu:noble
RUN if id "ubuntu" &>/dev/null; then \
echo "Deleting user 'ubuntu' for noble" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for noble"; \
else \
echo "User 'ubuntu' does not exist for noble"; \
fi
COPY first-run-notice.txt /tmp/scripts/
ENV LANG="C.UTF-8"
#Merging the mutiple layers to reduce the size of the image slightly
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Restore man command
&& yes | unminimize 2>&1 \
# Install basic build tools
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
make \
unzip \
# The tools in this package are used when installing packages for Python
build-essential \
swig3.0 \
# Required for Microsoft SQL Server
unixodbc-dev \
# Required for PostgreSQL
libpq-dev \
# Required for mysqlclient
default-libmysqlclient-dev \
# Required for ts
moreutils \
rsync \
zip \
libgdiplus \
jq \
# By default pip is not available in the buildpacks image
python3-pip \
#.NET Core related pre-requisites
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libncurses6 \
liblttng-ust1 \
libssl-dev \
libstdc++6 \
zlib1g \
libuuid1 \
libunwind8 \
sqlite3 \
libsqlite3-dev \
software-properties-common \
tk-dev \
uuid-dev \
curl \
gettext \
inotify-tools \
&& rm -rf /var/lib/apt/lists/* \
# This is the folder containing 'links' to benv and build script generator
&& apt-get update \
&& apt-get upgrade -y \
&& add-apt-repository universe \
&& rm -rf /var/lib/apt/lists/* \
# Verify expected build and debug tools are present
&& apt-get update \
&& apt-get -y install build-essential cmake cppcheck valgrind clang lldb llvm gdb python3-dev \
# Install tools and shells not in common script
&& apt-get install -yq vim vim-doc xtail software-properties-common libsecret-1-dev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y \
# Move first run notice to right spot
&& mkdir -p "/usr/local/etc/vscode-dev-containers/" \
&& mv -f /tmp/scripts/first-run-notice.txt /usr/local/etc/vscode-dev-containers/ \
# Install and setup fish
&& apt-get install -yq fish \
&& FISH_PROMPT="function fish_prompt\n set_color green\n echo -n (whoami)\n set_color normal\n echo -n \":\"\n set_color blue\n echo -n (pwd)\n set_color normal\n echo -n \"> \"\nend\n" \
&& printf "$FISH_PROMPT" >> /etc/fish/functions/fish_prompt.fish \
&& printf "if type code-insiders > /dev/null 2>&1; and not type code > /dev/null 2>&1\n alias code=code-insiders\nend" >> /etc/fish/conf.d/code_alias.fish \
# Remove scripts now that we're done with them
&& apt-get clean -y && rm -rf /tmp/scripts
# Install libssl1.1 for oryx compatibility based on architecture
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "amd64" ]; then \
curl -fsSL -o libssl1.1_1.1.0g-2ubuntu4_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
curl -fsSL -o libssl1.1_1.1.1f-1ubuntu2_arm64.deb http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
rm libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi
# Default to bash shell (other shells available at /usr/bin/fish and /usr/bin/zsh)
ENV SHELL=/bin/bash \
DOCKER_BUILDKIT=1
# Mount for docker-in-docker
VOLUME [ "/var/lib/docker" ]
CMD [ "sleep", "infinity" ]
# [Optional] Install debugger for development of Codespaces - Not in resulting image by default
ARG DeveloperBuild
RUN if [ -z $DeveloperBuild ]; then \
echo "not including debugger" ; \
else \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
fi