Skip to content

Commit

Permalink
Merge pull request #198 from commitd/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
stuarthendren authored Jul 25, 2021
2 parents 8c6d28f + 393c6b6 commit 89945ce
Show file tree
Hide file tree
Showing 488 changed files with 123,528 additions and 44,143 deletions.
50 changes: 44 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,39 @@

# [Choice] Node.js version: 14, 12, 10
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/docker-in-docker/.devcontainer/Dockerfile

# [Option] Install zsh
ARG INSTALL_ZSH="true"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"
# [Option] Enable non-root Docker access in container
ARG ENABLE_NONROOT_DOCKER="true"
# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine
ARG USE_MOBY="true"

# Install needed packages and setup non-root user. Use a separate RUN statement to add your
# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists.
ARG USERNAME=automatic
ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
# Use Docker script from script library to set things up
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

VOLUME [ "/var/lib/docker" ]

# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
# inside the container "overrideCommand": false is set in devcontainer.json.
# The script will also execute CMD if you need to alter startup behaviors.
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]

# Add additional packages
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand All @@ -13,10 +45,16 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& sudo apt-add-repository https://cli.github.com/packages \
&& sudo apt update \
# Install github cli
&& sudo apt -y install --no-install-recommends gh
&& sudo apt -y install --no-install-recommends gh \
&& npm install npm@latest -g

# Install act
RUN curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

# Add bash completions
# Install shell completions, only for the user (so we don't break anything in root)
RUN echo 'source <(gh completion -s bash)' >> ~/.bashrc \
&& echo 'source <(kubectl completion bash)' >> ~/.bashrc \
&& echo 'source <(skaffold completion bash)' >> ~/.bashrc \
&& touch ~/.bash_profile
&& echo 'source <(gh completion -s zsh)' >> ~/.zshrc \
&& touch ~/.bash_profile \
# Install useful oh-my-* shell plugins
&& sed -i.bak 's/^plugins=(\(.*\)/plugins=(debian docker docker-compose node npm yarn vscode \1/' ~/.zshrc \
&& sed -i.bak 's/^plugins=(\(.*\)/plugins=(npm \1/' ~/.bashrc
27 changes: 22 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
{
"name": "Node.js",
"name": "committed-component-devcontainer",
"runArgs": ["--init", "--privileged"],
"overrideCommand": false,
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
// Default to ZSH
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.shell.osx": "/usr/bin/zsh",
// Setup formatting to save with prettier
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Look throughout the project to auto set up eslint
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
// Our eslint can be very heavy, so we perform it on save not on type
"eslint.run": "onSave",
// Ignore uncommon words
"cSpell.userWords": ["commitd"],
// Prefer relative imports
"typescript.preferences.importModuleSpecifier": "relative"
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"ms-vsliveshare.vsliveshare",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
"ryanluker.vscode-coverage-gutters"
"streetsidesoftware.code-spell-checker"
],
"postCreateCommand": "yarn install",
"remoteUser": "node"
}
Loading

0 comments on commit 89945ce

Please sign in to comment.