Skip to content

Commit d962f9d

Browse files
authored
Merge pull request #11 from paulyuk/codespace
Porting codespace from C# to Python
2 parents 3dc075a + 488a8aa commit d962f9d

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/universal:latest
2+
3+
# Copy custom first notice message.
4+
COPY first-run-notice.txt /tmp/staging/
5+
RUN sudo mv -f /tmp/staging/first-run-notice.txt /usr/local/etc/vscode-dev-containers/ \
6+
&& sudo rm -rf /tmp/staging
7+
8+
# Install PowerShell 7.x
9+
RUN sudo apt-get update \
10+
&& sudo apt-get install -y wget apt-transport-https software-properties-common \
11+
&& wget -q https://packages.microsoft.com/config/ubuntu/$(. /etc/os-release && echo $VERSION_ID)/packages-microsoft-prod.deb \
12+
&& sudo dpkg -i packages-microsoft-prod.deb \
13+
&& sudo apt-get update \
14+
&& sudo apt-get install -y powershell
15+
16+
# Install Azure Functions Core Tools
17+
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
18+
&& sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
19+
&& sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' \
20+
&& sudo apt-get update \
21+
&& sudo apt-get install -y azure-functions-core-tools-4
22+
23+
# Install Azure Developer CLI
24+
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
25+
26+
# Install mechanical-markdown for quickstart validations
27+
RUN pip install mechanical-markdown

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Functions Quickstarts Codespace",
3+
"dockerFile": "Dockerfile",
4+
"features": {
5+
"azure-cli": "latest"
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-azuretools.vscode-bicep",
11+
"ms-azuretools.vscode-docker",
12+
"ms-azuretools.vscode-azurefunctions",
13+
"GitHub.copilot",
14+
"humao.rest-client"
15+
]
16+
}
17+
},
18+
"mounts": [
19+
// Mount docker-in-docker library volume
20+
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume"
21+
],
22+
// Always run image-defined docker-init.sh to enable docker-in-docker
23+
"overrideCommand": false,
24+
"remoteUser": "codespace",
25+
"runArgs": [
26+
// Enable ptrace-based debugging for Go in container
27+
"--cap-add=SYS_PTRACE",
28+
"--security-opt",
29+
"seccomp=unconfined",
30+
31+
// Enable docker-in-docker configuration
32+
"--init",
33+
"--privileged"
34+
]
35+
}
36+

.devcontainer/first-run-notice.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
👋 Welcome to the Functions Codespace! You are on the Functions Quickstarts image.
2+
It includes everything needed to run through our tutorials and quickstart applications.
3+
4+
📚 Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/

0 commit comments

Comments
 (0)