Skip to content

Commit c5afe25

Browse files
committed
Merge branch 'main' into fixforward
2 parents 3800681 + a01ab27 commit c5afe25

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.devcontainer/Dockerfile

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM ubuntu
2+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3+
4+
ENV EDITOR=vim
5+
6+
RUN apt-get update && apt-get upgrade
7+
8+
RUN apt-get install --yes \
9+
ca-certificates \
10+
bash-completion \
11+
build-essential \
12+
curl \
13+
cmake \
14+
direnv \
15+
emacs-nox \
16+
gnupg \
17+
htop \
18+
jq \
19+
less \
20+
lsb-release \
21+
lsof \
22+
man-db \
23+
nano \
24+
neovim \
25+
ssl-cert \
26+
sudo \
27+
unzip \
28+
xz-utils \
29+
zip
30+
31+
# configure locales to UTF8
32+
RUN apt-get install locales && locale-gen en_US.UTF-8
33+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
34+
35+
# configure direnv
36+
RUN direnv hook bash >> $HOME/.bashrc
37+
38+
# install nix
39+
RUN sh <(curl -L https://nixos.org/nix/install) --daemon
40+
41+
RUN mkdir -p $HOME/.config/nix $HOME/.config/nixpkgs \
42+
&& echo 'sandbox = false' >> $HOME/.config/nix/nix.conf \
43+
&& echo '{ allowUnfree = true; }' >> $HOME/.config/nixpkgs/config.nix \
44+
&& echo '. $HOME/.nix-profile/etc/profile.d/nix.sh' >> $HOME/.bashrc
45+
46+
47+
# install docker and configure daemon to use vfs as GitHub codespaces requires vfs
48+
# https://github.com/moby/moby/issues/13742#issuecomment-725197223
49+
RUN mkdir -p /etc/apt/keyrings \
50+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
51+
&& echo \
52+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
53+
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \
54+
&& apt-get update \
55+
&& apt-get install --yes docker-ce docker-ce-cli containerd.io docker-compose-plugin \
56+
&& mkdir -p /etc/docker \
57+
&& echo '{"cgroup-parent":"/actions_job","storage-driver":"vfs"}' >> /etc/docker/daemon.json
58+
59+
# install golang and language tooling
60+
ENV GO_VERSION=1.19
61+
ENV GOPATH=$HOME/go-packages
62+
ENV GOROOT=$HOME/go
63+
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
64+
RUN curl -fsSL https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz | tar xzs
65+
RUN echo 'export PATH=$GOPATH/bin:$PATH' >> $HOME/.bashrc
66+
67+
RUN bash -c ". $HOME/.bashrc \
68+
go install -v golang.org/x/tools/gopls@latest \
69+
&& go install -v mvdan.cc/sh/v3/cmd/shfmt@latest \
70+
"
71+
72+
# install nodejs
73+
RUN bash -c "$(curl -fsSL https://deb.nodesource.com/setup_14.x)" \
74+
&& apt-get install -y nodejs
75+
76+
# install zstd
77+
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/horta/zstd.install/main/install)"
78+
79+
# install nfpm
80+
RUN echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list \
81+
&& apt update \
82+
&& apt install nfpm
83+

.devcontainer/devcontainer.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// For format details, see https://aka.ms/devcontainer.json
2+
{
3+
"name": "Development environments on your infrastructure",
4+
5+
// Sets the run context to one level up instead of the .devcontainer folder.
6+
"context": ".",
7+
8+
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9+
"dockerFile": "Dockerfile",
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
"postStartCommand": "dockerd",
15+
16+
// privileged is required by GitHub codespaces - https://github.com/microsoft/vscode-dev-containers/issues/727
17+
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--privileged", "--init" ]
18+
}

0 commit comments

Comments
 (0)