forked from kedacore/keda-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dev-container (kedacore#784)
- Loading branch information
Jorge Turrado Ferrero
authored
Jun 15, 2022
1 parent
83b96de
commit e91ad74
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM node:18.3.0-slim | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux, | ||
# this user's GID/UID must match your local user UID/GID to avoid permission issues | ||
# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See | ||
# https://aka.ms/vscode-remote/containers/non-root-user for details. | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Configure apt, install packages and tools | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | ||
# | ||
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed | ||
&& apt-get -y install git iproute2 procps lsb-release | ||
|
||
# [Optional] Add sudo support | ||
RUN apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
# | ||
# deps | ||
RUN apt-get install -y make curl | ||
# | ||
# Clean up | ||
RUN apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at | ||
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/go | ||
{ | ||
"name": "Npm", | ||
"dockerFile": "Dockerfile", | ||
"runArgs": [ | ||
// Uncomment the next line to use a non-root user. On Linux, this will prevent | ||
// new files getting created as root, but you may need to update the USER_UID | ||
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000. | ||
// "-u", "vscode", | ||
|
||
// Cache vscode exentsions installs and homedir | ||
"-v", "keda-docs-vscodecache:/root/.vscode-server", | ||
|
||
// Mount docker socket for doecker builds | ||
"-v", "/var/run/docker.sock:/var/run/docker.sock", | ||
|
||
"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" | ||
], | ||
|
||
// Use 'settings' to set *default* container specific settings.json values on container create. | ||
// You can edit these settings after create using File > Preferences > Settings > Remote. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created in the array below. | ||
"extensions": [ | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# normalize all introduced text files to LF line endings (recognized by git) | ||
* text=auto | ||
# additionally declare text file types | ||
*.sh text eol=lf |