Skip to content

Commit 89945ce

Browse files
Merge pull request #198 from commitd/beta
Beta
2 parents 8c6d28f + 393c6b6 commit 89945ce

File tree

488 files changed

+123528
-44143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+123528
-44143
lines changed

.devcontainer/Dockerfile

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,39 @@
22

33
# [Choice] Node.js version: 14, 12, 10
44
ARG VARIANT="14-buster"
5-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
5+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
6+
7+
# https://github.com/microsoft/vscode-dev-containers/blob/master/containers/docker-in-docker/.devcontainer/Dockerfile
8+
9+
# [Option] Install zsh
10+
ARG INSTALL_ZSH="true"
11+
# [Option] Upgrade OS packages to their latest versions
12+
ARG UPGRADE_PACKAGES="false"
13+
# [Option] Enable non-root Docker access in container
14+
ARG ENABLE_NONROOT_DOCKER="true"
15+
# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine
16+
ARG USE_MOBY="true"
17+
18+
# Install needed packages and setup non-root user. Use a separate RUN statement to add your
19+
# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists.
20+
ARG USERNAME=automatic
21+
ARG USER_UID=1000
22+
ARG USER_GID=$USER_UID
23+
COPY library-scripts/*.sh /tmp/library-scripts/
24+
RUN apt-get update \
25+
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
26+
# Use Docker script from script library to set things up
27+
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" \
28+
# Clean up
29+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/
30+
31+
VOLUME [ "/var/lib/docker" ]
32+
33+
# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
34+
# inside the container "overrideCommand": false is set in devcontainer.json.
35+
# The script will also execute CMD if you need to alter startup behaviors.
36+
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
37+
CMD [ "sleep", "infinity" ]
638

739
# Add additional packages
840
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
@@ -13,10 +45,16 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1345
&& sudo apt-add-repository https://cli.github.com/packages \
1446
&& sudo apt update \
1547
# Install github cli
16-
&& sudo apt -y install --no-install-recommends gh
48+
&& sudo apt -y install --no-install-recommends gh \
49+
&& npm install npm@latest -g
50+
51+
# Install act
52+
RUN curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
1753

18-
# Add bash completions
54+
# Install shell completions, only for the user (so we don't break anything in root)
1955
RUN echo 'source <(gh completion -s bash)' >> ~/.bashrc \
20-
&& echo 'source <(kubectl completion bash)' >> ~/.bashrc \
21-
&& echo 'source <(skaffold completion bash)' >> ~/.bashrc \
22-
&& touch ~/.bash_profile
56+
&& echo 'source <(gh completion -s zsh)' >> ~/.zshrc \
57+
&& touch ~/.bash_profile \
58+
# Install useful oh-my-* shell plugins
59+
&& sed -i.bak 's/^plugins=(\(.*\)/plugins=(debian docker docker-compose node npm yarn vscode \1/' ~/.zshrc \
60+
&& sed -i.bak 's/^plugins=(\(.*\)/plugins=(npm \1/' ~/.bashrc

.devcontainer/devcontainer.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
11
{
2-
"name": "Node.js",
2+
"name": "committed-component-devcontainer",
3+
"runArgs": ["--init", "--privileged"],
4+
"overrideCommand": false,
35
"build": {
46
"dockerfile": "Dockerfile",
57
"args": {
68
"VARIANT": "14"
79
}
810
},
911
"settings": {
10-
"terminal.integrated.shell.linux": "/bin/bash"
12+
// Default to ZSH
13+
"terminal.integrated.shell.linux": "/bin/bash",
14+
"terminal.integrated.shell.osx": "/usr/bin/zsh",
15+
// Setup formatting to save with prettier
16+
"editor.formatOnSave": true,
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
// Look throughout the project to auto set up eslint
19+
"eslint.workingDirectories": [
20+
{
21+
"mode": "auto"
22+
}
23+
],
24+
// Our eslint can be very heavy, so we perform it on save not on type
25+
"eslint.run": "onSave",
26+
// Ignore uncommon words
27+
"cSpell.userWords": ["commitd"],
28+
// Prefer relative imports
29+
"typescript.preferences.importModuleSpecifier": "relative"
1130
},
1231
"extensions": [
1332
"dbaeumer.vscode-eslint",
1433
"esbenp.prettier-vscode",
1534
"github.vscode-pull-request-github",
1635
"ms-vsliveshare.vsliveshare",
1736
"eamodio.gitlens",
18-
"streetsidesoftware.code-spell-checker",
19-
"ryanluker.vscode-coverage-gutters"
37+
"streetsidesoftware.code-spell-checker"
2038
],
21-
"postCreateCommand": "yarn install",
2239
"remoteUser": "node"
2340
}

0 commit comments

Comments
 (0)