-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitpod.Dockerfile
54 lines (42 loc) · 2.07 KB
/
.gitpod.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM gitpod/workspace-base
USER root
# Install docker
RUN curl -o /var/lib/apt/dazzle-marks/docker.gpg -fsSL https://download.docker.com/linux/ubuntu/gpg \
&& apt-key add /var/lib/apt/dazzle-marks/docker.gpg \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& install-packages docker-ce docker-ce-cli containerd.io
RUN curl -o /usr/bin/slirp4netns -fsSL https://github.com/rootless-containers/slirp4netns/releases/download/v1.1.12/slirp4netns-$(uname -m) \
&& chmod +x /usr/bin/slirp4netns
RUN curl -o /usr/local/bin/docker-compose -fsSL https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 \
&& chmod +x /usr/local/bin/docker-compose
# Install tailscale
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.gpg | sudo apt-key add - \
&& curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.list | sudo tee /etc/apt/sources.list.d/tailscale.list \
&& apt-get update \
&& apt-get install -y tailscale
# Install Nix
RUN addgroup --system nixbld \
&& adduser gitpod nixbld \
&& for i in $(seq 1 30); do useradd -ms /bin/bash nixbld$i && adduser nixbld$i nixbld; done \
&& mkdir -m 0755 /nix && chown gitpod /nix \
&& mkdir -p /etc/nix && echo 'sandbox = false' > /etc/nix/nix.conf
# Install Nix
CMD /bin/bash -l
USER gitpod
ENV USER gitpod
WORKDIR /home/gitpod
RUN touch .bash_profile \
&& curl https://nixos.org/releases/nix/nix-2.3.14/install | sh
RUN echo '. /home/gitpod/.nix-profile/etc/profile.d/nix.sh' >> /home/gitpod/.bashrc
RUN mkdir -p /home/gitpod/.config/nixpkgs && echo '{ allowUnfree = true; }' >> /home/gitpod/.config/nixpkgs/config.nix
# Install cachix
RUN . /home/gitpod/.nix-profile/etc/profile.d/nix.sh \
&& nix-env -iA cachix -f https://cachix.org/api/v1/install \
&& cachix use cachix
# Install git
RUN . /home/gitpod/.nix-profile/etc/profile.d/nix.sh \
&& nix-env -i git git-lfs
# Install direnv
RUN . /home/gitpod/.nix-profile/etc/profile.d/nix.sh \
&& nix-env -i direnv \
&& direnv hook bash >> /home/gitpod/.bashrc