File tree 3 files changed +39
-6
lines changed
3 files changed +39
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
2
+ # Use of this source code is governed by a BSD-style
3
+ # license that can be found in the LICENSE file.
4
+
5
+ FROM mcr.microsoft.com/vscode/devcontainers/universal:linux as builder
6
+ USER root
7
+
8
+ # Magic DNS in a container where /etc/resolv.conf is a bind mount needed
9
+ # extra support, currently on a development branch.
10
+ WORKDIR /go/src/tailscale
11
+ COPY . ./
12
+ RUN git clone https://github.com/tailscale/tailscale.git && cd tailscale && \
13
+ go mod download && \
14
+ go install -mod=readonly ./cmd/tailscaled ./cmd/tailscale
15
+ COPY . ./
16
+
17
+ FROM mcr.microsoft.com/vscode/devcontainers/universal:linux
18
+ USER root
19
+
20
+ RUN apt-get update && apt-get install -y curl gpg dnsutils
21
+ COPY tailscaled /etc/init.d
22
+ COPY --from=builder /go/bin/tailscaled /usr/sbin/tailscaled
23
+ COPY --from=builder /go/bin/tailscale /usr/bin/tailscale
24
+
25
+ RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " Tailscale-enabled Codespace" ,
3
+ "dockerFile" : " .codespace.Dockerfile" ,
4
+ "context" : " .." ,
5
+ "runArgs" : [
6
+ " --cap-add=NET_ADMIN" ,
7
+ " --cap-add=NET_RAW" ,
8
+ " --device=/dev/net/tun"
9
+ ],
10
+ "postStartCommand" : " /etc/init.d/tailscaled start" ,
11
+ }
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- # Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
3
- # Use of this source code is governed by a BSD-style
4
- # license that can be found in the LICENSE file.
5
2
6
3
# ## BEGIN INIT INFO
7
4
# Provides: tailscaled
@@ -32,10 +29,10 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
32
29
case " $1 " in
33
30
start)
34
31
log_daemon_msg " Starting Tailscale VPN" " tailscaled" || true
35
- if start-stop-daemon --start --quiet --oknodo --pidfile /run/tailscaled.pid --background \
36
- --exec sudo /usr/sbin/tailscaled -- --state=/var/lib/tailscale/tailscaled.state \
32
+ if start-stop-daemon --start --quiet --oknodo --chuid 0:0 -- pidfile /run/tailscaled.pid --background \
33
+ --exec /usr/sbin/tailscaled -- --state=/var/lib/tailscale/tailscaled.state \
37
34
--socket=/run/tailscale/tailscaled.sock --port 41641; then
38
- sudo -E tailscale up --hostname=gitpod --authkey=${TAILSCALE_AUTHKEY} --netfilter-mode=off
35
+ tailscale up --authkey=${TAILSCALE_AUTHKEY} --netfilter-mode=off
39
36
log_end_msg 0 || true
40
37
else
41
38
log_end_msg 1 || true
You can’t perform that action at this time.
0 commit comments