Created
October 27, 2021 14:21
Dockerfile for developing javascript OpenFaas functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG VARIANT="3.14" | |
ARG NODE_VERSION="14" | |
FROM node:${NODE_VERSION}-alpine as NODE | |
FROM mcr.microsoft.com/vscode/devcontainers/base:0-alpine-${VARIANT} | |
ARG DOCKER_GID="1001" # Override with appropriate Docker group ID | |
# Install basic dependencies | |
RUN apk update \ | |
&& apk add --no-cache ca-certificates docker-cli terraform \ | |
git vim wget curl openssl grep libstdc++ coreutils bash \ | |
&& update-ca-certificates | |
# Install kubectl | |
RUN wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ | |
-O /usr/local/bin/kubectl \ | |
&& chmod +x /usr/local/bin/kubectl | |
RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | ash | |
RUN curl -sSL https://cli.openfaas.com | ash | |
# Install node | |
COPY --from=NODE /usr/local/lib/node_modules /usr/local/lib/node_modules | |
COPY --from=NODE /usr/local/bin/node /usr/local/bin/node | |
RUN ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \ | |
&& ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ | |
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs | |
RUN npm i -g yarn stylelint eslint jest prettier | |
# Create symlinks | |
RUN mkdir -p /home/vscode/.vs-kubernetes/tools/kubectl \ | |
&& mkdir -p /home/vscode/.vs-kubernetes/tools/helm/linux-amd64 \ | |
&& chown -R vscode:vscode /home/vscode/.vs-kubernetes \ | |
&& ln -s $(which kubectl) /home/vscode/.vs-kubernetes/tools/kubectl/kubectl \ | |
&& ln -s $(which helm) /home/vscode/.vs-kubernetes/tools/helm/linux-amd64/helm | |
USER vscode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment