Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit c65fed7

Browse files
authored
Merge pull request #262 from dougnukem/doug/fix-sail-docker
Fix sail docker and upgrade code-server
2 parents 4ac2968 + 0234e43 commit c65fed7

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.sail/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM codercom/ubuntu-dev-go:latest
22
SHELL ["/bin/bash", "-c"]
3+
34
RUN sudo apt-get update && \
4-
sudo apt-get install -y htop
5+
sudo apt-get install -y htop
6+
57
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash && \
68
. ~/.nvm/nvm.sh \
79
&& nvm install node
@@ -12,5 +14,3 @@ LABEL project_root "~/go/src/go.coder.com"
1214
RUN wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.55.4/hugo_extended_0.55.4_Linux-64bit.deb && \
1315
sudo dpkg -i /tmp/hugo.deb && \
1416
rm -f /tmp/hugo.deb
15-
16-
RUN installext peterjausovec.vscode-docker

images/base/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM buildpack-deps:cosmic
1+
FROM buildpack-deps:20.04
22

33
RUN apt-get update && apt-get install -y \
44
vim \
@@ -23,8 +23,12 @@ ENV LC_ALL=en_US.UTF-8
2323
# Download in code-server into path. sail will typically override the binary
2424
# anyways, but it's nice to have this during the build pipepline so we can
2525
# install extensions.
26-
RUN wget -O /usr/bin/code-server https://codesrv-ci.cdr.sh/latest-linux && \
27-
chmod +x /usr/bin/code-server
2826

27+
RUN wget -O code-server.tgz "https://codesrv-ci.cdr.sh/releases/3.0.1/linux-x86_64.tar.gz" && \
28+
tar -C /usr/lib -xzf code-server.tgz && \
29+
rm code-server.tgz && \
30+
ln -s /usr/lib/code-server-3.0.1-linux-x86_64/code-server /usr/bin/code-server && \
31+
chmod +x /usr/lib/code-server-3.0.1-linux-x86_64/code-server && \
32+
chmod +x /usr/bin/code-server
2933

3034
ADD installext /usr/bin/installext

images/ubuntu-dev-go/install_go_tools.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ $GOPATH/bin/gometalinter --install
3131

3232
# gopls is generally recommended over community tools.
3333
# It's much faster and more reliable than the other options.
34-
go get -u golang.org/x/tools/cmd/gopls
34+
# FIX: https://github.com/golang/go/issues/36442 by running as described here https://github.com/golang/tools/blob/master/gopls/doc/user.md#installation
35+
GO111MODULE=on go get golang.org/x/tools/gopls@latest
3536

internal/codeserver/download.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ func DownloadURL(ctx context.Context) (string, error) {
2020
return "", xerrors.Errorf("failed to get latest code-server release: %w", err)
2121
}
2222
for _, v := range rel.Assets {
23-
// TODO: fix this jank.
24-
if strings.Index(*v.Name, "linux") < 0 {
23+
// TODO: fix this jank, detect container architecture instead of hardcoding to x86_64
24+
if strings.Index(*v.Name, "linux-x86_64") < 0 {
2525
continue
2626
}
2727
return *v.BrowserDownloadURL, nil

runner.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ cd %v
169169
# This is necessary in case the .vscode directory wasn't created inside the container, as mounting to the host
170170
# extension dir will create it as root.
171171
sudo chown user:user ~/.vscode
172-
code-server --host %v --port %v \
173-
--data-dir ~/.config/Code --extensions-dir %v --extra-extensions-dir ~/.vscode/extensions --allow-http --no-auth 2>&1 | tee %v
174-
`, projectDir, containerAddr, containerPort, hostExtensionsDir, containerLogPath)
172+
/usr/bin/code-server --host %v --port %v --user-data-dir ~/.config/Code --extensions-dir %v --extra-extensions-dir ~/.vscode/extensions --auth=none \
173+
--allow-http 2>&1 | tee %v`,
174+
projectDir, containerAddr, containerPort, hostExtensionsDir, containerLogPath)
175+
175176
if r.testCmd != "" {
176177
cmd = r.testCmd + "\n exit 1"
177178
}

0 commit comments

Comments
 (0)