Chuck Lantz 2020-08-14 20:14:43 -07:00
Родитель 764f592b40 e5a7b7ef3d
Коммит 63d393a252
8 изменённых файлов: 128 добавлений и 23 удалений

Просмотреть файл

@ -905,7 +905,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "python",
"Digest": "sha256:b04db6093bb158affaa89ac5af1281e748092433442e8ae0096ba8fbe37f00cc",
"Digest": "sha256:2c1045587e4452d49544c6dce92efe21c3b4b33864cfb56fdee66a2c8585c769",
"Tag": "3"
}
}
@ -915,7 +915,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "python",
"Digest": "sha256:b04db6093bb158affaa89ac5af1281e748092433442e8ae0096ba8fbe37f00cc",
"Digest": "sha256:2c1045587e4452d49544c6dce92efe21c3b4b33864cfb56fdee66a2c8585c769",
"Tag": "3.8"
}
}
@ -925,7 +925,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "python",
"Digest": "sha256:45a9d9059c9a83066f66d0c7ef7f344bd55f2a41c7a32ca73b2b7bad363ed2b9",
"Digest": "sha256:6ca82c8d96a24523a71f40bb38f5682b18ca74a7a19586927c79e714b1b906c4",
"Tag": "3.7"
}
}
@ -935,7 +935,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "python",
"Digest": "sha256:a396ca2b3933dd497ab82f32982a746bfa20952948bd9681eb19c8d26f80faf0",
"Digest": "sha256:4ec64894c98dd0de6804e046359be6ae0820699d89a98ed4b2f62ccbea37f044",
"Tag": "3.6"
}
}
@ -1458,7 +1458,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "node",
"Digest": "sha256:94a00394bc5a8ef503fb59db0a7d0ae9e1119866e8aee8ba40cd864cea69ea1a",
"Digest": "sha256:8b6401f8d15c900736a54a870994277b3de19ebd28cc483c497bf00d608e2a90",
"Tag": "14"
}
}
@ -1668,7 +1668,7 @@
"Type": "npm",
"Npm": {
"Name": "eslint",
"Version": "7.6.0"
"Version": "7.7.0"
}
}
},
@ -1677,7 +1677,7 @@
"Type": "DockerImage",
"DockerImage": {
"Name": "node",
"Digest": "sha256:94a00394bc5a8ef503fb59db0a7d0ae9e1119866e8aee8ba40cd864cea69ea1a",
"Digest": "sha256:8b6401f8d15c900736a54a870994277b3de19ebd28cc483c497bf00d608e2a90",
"Tag": "14"
}
}
@ -1719,15 +1719,7 @@
"Version": "3.9.7"
}
}
}, {
"Component": {
"Type": "go",
"Go": {
"Name": "golang.org/x/tools/gopls",
"Version": "latest"
}
}
}
}
],
"Version": 1
}
}

Просмотреть файл

@ -1,7 +1,4 @@
# **********************************************************
# * Note: Using a Dockerfile is optional when using Docker *
# * Compose but has been included here for completeness. *
# **********************************************************
# Add your image here
ARG VARIANT="buster"
FROM buildpack-deps:${VARIANT}-curl
@ -14,7 +11,7 @@ ARG USER_GID=$USER_UID
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
COPY library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
#
# ****************************************************************************

Просмотреть файл

@ -1,3 +1,4 @@
# Add your image here
ARG VARIANT="buster"
FROM buildpack-deps:${VARIANT}-curl
@ -10,7 +11,7 @@ ARG USER_GID=$USER_UID
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
COPY library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
#
# ****************************************************************************

Просмотреть файл

@ -0,0 +1,20 @@
# Find the Dockerfile for mcr.microsoft.com/azure-functions/java:3.0-java8-core-tools at this URL
# https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/java/java8/java8-core-tools.Dockerfile
FROM mcr.microsoft.com/azure-functions/java:3.0-java11-core-tools
# Uncomment following lines If you want to enable Development Container Script
# For more details https://github.com/microsoft/vscode-dev-containers/tree/master/script-library
# Avoid warnings by switching to noninteractive
# ENV DEBIAN_FRONTEND=noninteractive
# # Comment out these lines if you want to use zsh.
# ARG INSTALL_ZSH=true
# ARG USERNAME=vscode
# ARG USER_UID=1000
# ARG USER_GID=$USER_UID
# RUN apt-get update && curl -ssL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh -o /tmp/common-script.sh \
# && /bin/bash /tmp/common-script.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \
# && rm /tmp/common-script.sh

Просмотреть файл

@ -0,0 +1,23 @@
{
"name": "Azure Functions & Java 11",
"dockerFile": "Dockerfile",
"forwardPorts": [ 7071 ],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"java.home": "/usr/lib/jvm/zulu-11-azure-amd64"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"vscjava.vscode-java-pack"
]
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}

Просмотреть файл

@ -0,0 +1,6 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/usr/share/maven/ref/repository</localRepository>
</settings>

Просмотреть файл

@ -0,0 +1,5 @@
README.md
test-project
definition-manifest.json
.vscode
.npmignore

Просмотреть файл

@ -0,0 +1,61 @@
# Azure Functions & Java 11
## Summary
*Develop Azure Functions in Java. Includes JDK 11, Maven, XML tools, the Azure Functions SDK, and related extensions and dependencies.*
| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Java Team |
| *Definition type* | Dockerfile |
| *Works in Codespaces* | Yes |
| *Container host OS support* | Linux, macOS, Windows |
| *Languages, platforms* | Azure Functions, Java |
## Using this definition with an existing folder
This definition requires an Azure subscription to use. You can create a [free account here](https://azure.microsoft.com/en-us/free/serverless/), learn more about using [Azure Functions with VS Code](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code) and [Java Azure Functions with VS Code](https://code.visualstudio.com/docs/java/java-azurefunctions) here. Once you have an Azure account, follow these steps:
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.
2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette.
3. Select the Azure Functions & Java 11 definition.
3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/azure-functions-java-11/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
## Testing the definition
This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:
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.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/azure-functions-java-11` folder.
5. After the folder has opened in the container, press <kbd>F1</kbd> and select **Azure Functions: Create Function...**.
6. Enter these options:
1. Yes (when prompted to create a new project)
2. Java
3. HTTP Trigger
4. HTTPTrigger-Java
5. Anonymous
6. Open in current window
7. Press <kbd>F5</kbd> to start debugging project.
8. After the debugger is started, open a local browser and enter the URL: `http://localhost:7071/api/HttpTrigger-Java?name=remote`.
- If the port 7071 is not already open, press <kbd>F1</kbd>, select **Remote-Containers: Forward Port from Container...**, and then port 7071.
9. You should see "Hello, remote" echoed by the Azure Function.
10. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
## License
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).