Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit b2c023f

Browse files
Add java azure-functions container definition
Signed-off-by: Jinbo Wang <[email protected]>
1 parent 7821915 commit b2c023f

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#-----------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See LICENSE in the project root for license information.
4+
#-----------------------------------------------------------------------------------------
5+
6+
FROM maven:3-jdk-8
7+
8+
# Configure apt
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
RUN apt-get update \
11+
&& apt-get -y install --no-install-recommends apt-utils 2>&1
12+
13+
# Install dotnet core sdk - See https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/stretch/amd64/Dockerfile
14+
# Install .NET CLI dependencies
15+
RUN apt-get install -y --no-install-recommends \
16+
libc6 \
17+
libgcc1 \
18+
libgssapi-krb5-2 \
19+
libicu57 \
20+
liblttng-ust0 \
21+
libssl1.0.2 \
22+
libstdc++6 \
23+
zlib1g
24+
25+
# Install .NET Core SDK
26+
ENV DOTNET_SDK_VERSION 2.1.603
27+
28+
RUN curl -SL --output dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
29+
&& dotnet_sha512='dd0efb8aae75d8f48ef3abbeca38ae14d2621a47e37b2d9d74755b58f9173343305f1a62cfa9a03f17c42f58b1d1b653d271e7d1327c81ff4af0a54c43c7db59' \
30+
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
31+
&& mkdir -p /usr/share/dotnet \
32+
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
33+
&& rm dotnet.tar.gz \
34+
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
35+
36+
# Configure web servers to bind to port 80 when present
37+
ENV ASPNETCORE_URLS=http://+:80 \
38+
# Enable detection of running in a container
39+
DOTNET_RUNNING_IN_CONTAINER=true \
40+
# Enable correct mode for dotnet watch (only mode supported in a container)
41+
DOTNET_USE_POLLING_FILE_WATCHER=true \
42+
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
43+
NUGET_XMLDOC_MODE=skip
44+
45+
# Trigger first run experience by running arbitrary cmd to populate local package cache
46+
RUN dotnet help
47+
48+
# Verify git and needed tools are installed
49+
RUN apt-get -y install \
50+
git \
51+
procps \
52+
curl \
53+
apt-transport-https \
54+
gnupg2 \
55+
lsb-release
56+
57+
# Install Azure Functions and Azure CLI
58+
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
59+
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \
60+
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
61+
&& apt-get update \
62+
&& apt-get install -y azure-cli azure-functions-core-tools
63+
64+
# Clean up
65+
RUN apt-get autoremove -y \
66+
&& apt-get clean -y \
67+
&& rm -rf /var/lib/apt/lists/*
68+
ENV DEBIAN_FRONTEND=dialog
69+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Azure Functions & Java 8",
3+
"dockerFile": "Dockerfile",
4+
"appPort": 7071,
5+
"extensions": [
6+
"ms-azuretools.vscode-azurefunctions",
7+
"vscjava.vscode-java-pack",
8+
"redhat.vscode-xml"
9+
]
10+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README.md
2+
test-project
3+
.vscode
4+
.npmignore
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Azure Functions & Java 8
2+
3+
## Summary
4+
5+
*Develop Azure Functions in Java. Includes JDK 8, Maven, XML tools, the Azure Functions SDK, and related extensions and dependencies.*
6+
7+
| Metadata | Value |
8+
|----------|-------|
9+
| *Contributors* | The VS Code Java Team |
10+
| *Definition type* | Dockerfile |
11+
| *Languages, platforms* | Azure Functions, Java |
12+
13+
## Using this definition with an existing folder
14+
15+
This definition requires an Azure subscription to use. You can create a [free account here](https://azure.microsoft.com/en-us/free/serverless/) and learn more about using [Azure Functions with VS Code here](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code). Once you have an Azure account, follow these steps:
16+
17+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
18+
19+
2. To use VS Code's copy of this definition:
20+
1. Start VS Code and open your project folder.
21+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
22+
3. Select the Azure Functions & Java 8 definition.
23+
24+
3. To use latest-and-greatest copy of this definition from the repository:
25+
1. Clone this repository.
26+
2. Copy the contents of `containers/azure-functions-java-8/.devcontainer` to the root of your project folder.
27+
3. Start VS Code and open your project folder.
28+
29+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
30+
31+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
32+
33+
## License
34+
35+
Copyright (c) Microsoft Corporation. All rights reserved.
36+
37+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

0 commit comments

Comments
 (0)