Add vs code dev container (#7052)

This commit is contained in:
Sean Fausett 2021-05-15 05:28:45 +12:00 committed by GitHub
parent f378e68367
commit 2a42931915
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 0 deletions

39
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,39 @@
FROM pulumi/pulumi
# Install golangci-lint
RUN version=1.40.0 \
&& curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v$version \
&& golangci-lint version
# Install pipenv
RUN pip install pipenv
# Install pulumictl
RUN version=0.0.25 \
&& curl -fsSLO https://github.com/pulumi/pulumictl/releases/download/v$version/pulumictl-v$version-linux-amd64.tar.gz \
&& tar -xzf pulumictl-v$version-linux-amd64.tar.gz --directory /usr/local/bin --no-same-owner pulumictl \
&& rm -f pulumictl-v$version-linux-amd64.tar.gz \
&& pulumictl version
# Add non-root user
ARG USER_NAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USER_NAME \
&& useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash -m $USER_NAME \
&& echo "$USER_NAME ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_NAME \
&& chmod 0440 /etc/sudoers.d/$USER_NAME
RUN mkdir -p /go/bin \
&& chown -R $USER_NAME: /go \
&& mkdir -p /opt/pulumi/bin \
&& chown -R $USER_NAME: /opt/pulumi
USER $USER_NAME
RUN echo "export PATH=/opt/pulumi:/opt/pulumi/bin:$GOPATH/bin:/usr/local/go/bin:$PATH" >> ~/.bashrc \
&& echo "unset XDG_CACHE_HOME XDG_CONFIG_HOME" >> ~/.bashrc \
&& echo "alias l='ls -aF'" >> ~/.bash_aliases \
&& echo "alias ll='ls -ahlF'" >> ~/.bash_aliases \
&& echo "alias ls='ls --color=auto --group-directories-first'" >> ~/.bash_aliases

View file

@ -0,0 +1,23 @@
{
"name": "Pulumi",
"build": {
"dockerfile": "Dockerfile",
"args": {
"USER_NAME": "user",
"USER_UID": "1000"
}
},
"runArgs": [
"-e",
"PULUMI_ACCESS_TOKEN",
"-e",
"PULUMI_TEST_ORG"
],
"remoteUser": "user",
"settings": {
"extensions.ignoreRecommendations": true
}
}

View file

@ -30,3 +30,8 @@
- Ensure that all outstanding asynchronous work is awaited before returning from a .NET
Pulumi program.
[#6993](https://github.com/pulumi/pulumi/pull/6993)
### Misc.
- Build: Add vs code dev container
[#7052](https://github.com/pulumi/pulumi/pull/7052)