Skip to content

Instantly share code, notes, and snippets.

@ssugimoto
Created August 8, 2021 12:26
Show Gist options
  • Save ssugimoto/132e0785212be58b0c0a6b4b7b42bc91 to your computer and use it in GitHub Desktop.
Save ssugimoto/132e0785212be58b0c0a6b4b7b42bc91 to your computer and use it in GitHub Desktop.
AWS Lambda and VSCode Remote container ,for Python3.8
{
"name": "python3.8",
"dockerFile": "Dockerfile",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
// Git Extension Pack => "donjayamanne.git-extension-pack"
// GraphQL => "graphql.vscode-graphql"
// GraphQL for VSCode => kumar-harsh.graphql-for-vscode
"extensions": [
"dbaeumer.vscode-eslint",
"ms-python.python",
"ms-python.vscode-pylance",
"mhutchie.git-graph",
"eamodio.gitlens"
],
// Mount ~/.aws directory for AWS Amplify CLI and AWS CLI access
// Mount ~/.ssh directory for Git Repository GitHub, GitLab ...
//"source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/root/.aws,type=bind,consistency=cached",
//"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/root/.ssh,type=bind,consistency=cached"
"mounts": [
"source=${localWorkspaceFolder}/aws,target=/root/.aws,type=bind,consistency=cached",
"source=${localWorkspaceFolder}/ssh,target=/root/.ssh,type=bind,consistency=cached",
],
// Use in-container folder (not mounted host directory) as a workspace to speeeeeeed-up the `npx create-react-app` command. See https://github.com/toricls/aws-amplify-sns-workshop-in-vscode/pull/3.
// {localWorkspaceFolder} is open folder host path.
"workspaceMount": "source=${localWorkspaceFolder},target=/hostdir,type=bind,consistency=cached",
"workspaceFolder": "/workspaces",
"containerEnv": {
"MOUNTED_HOST_DIR": "${localWorkspaceFolder}",
"MOUNTED_HOST_DIR_PATH_IN_CONTAINER": "/hostdir"
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// npm , amplify mock api , 62224 DynamoDB
// "forwardPorts": [3000,20002],
// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "npm install -g @aws-amplify/[email protected]",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
// docker container name (Identify Dev Containers)
"runArgs": [
"--name=python38-dev_container"
]
}
FROM mcr.microsoft.com/vscode/devcontainers/python:3.8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install --no-install-recommends java-common zip \
&& wget https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.deb \
&& dpkg --install amazon-corretto-8-x64-linux-jdk.deb \
&& wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip \
&& unzip awscli-exe-linux-x86_64.zip \
&& ./aws/install \
# Clean up
&& rm -f awscli-exe-linux-x86_64.zip \
&& rm -f amazon-corretto-8-x64-linux-jdk.deb \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog
WORKDIR /workspaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment