diff --git a/.sail/Dockerfile b/.sail/Dockerfile index aca884c..6f4d7a5 100644 --- a/.sail/Dockerfile +++ b/.sail/Dockerfile @@ -1,7 +1,9 @@ FROM codercom/ubuntu-dev-go:latest SHELL ["/bin/bash", "-c"] + RUN sudo apt-get update && \ - sudo apt-get install -y htop + sudo apt-get install -y htop + RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash && \ . ~/.nvm/nvm.sh \ && nvm install node @@ -12,5 +14,3 @@ LABEL project_root "~/go/src/go.coder.com" RUN wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.55.4/hugo_extended_0.55.4_Linux-64bit.deb && \ sudo dpkg -i /tmp/hugo.deb && \ rm -f /tmp/hugo.deb - -RUN installext peterjausovec.vscode-docker diff --git a/images/base/Dockerfile b/images/base/Dockerfile index a87819d..1c4b1bf 100644 --- a/images/base/Dockerfile +++ b/images/base/Dockerfile @@ -1,4 +1,4 @@ -FROM buildpack-deps:cosmic +FROM buildpack-deps:20.04 RUN apt-get update && apt-get install -y \ vim \ @@ -23,8 +23,12 @@ ENV LC_ALL=en_US.UTF-8 # Download in code-server into path. sail will typically override the binary # anyways, but it's nice to have this during the build pipepline so we can # install extensions. -RUN wget -O /usr/bin/code-server https://codesrv-ci.cdr.sh/latest-linux && \ - chmod +x /usr/bin/code-server +RUN wget -O code-server.tgz "https://codesrv-ci.cdr.sh/releases/3.0.1/linux-x86_64.tar.gz" && \ + tar -C /usr/lib -xzf code-server.tgz && \ + rm code-server.tgz && \ + ln -s /usr/lib/code-server-3.0.1-linux-x86_64/code-server /usr/bin/code-server && \ + chmod +x /usr/lib/code-server-3.0.1-linux-x86_64/code-server && \ + chmod +x /usr/bin/code-server ADD installext /usr/bin/installext \ No newline at end of file diff --git a/images/ubuntu-dev-go/install_go_tools.sh b/images/ubuntu-dev-go/install_go_tools.sh index 859f384..b0f4e37 100755 --- a/images/ubuntu-dev-go/install_go_tools.sh +++ b/images/ubuntu-dev-go/install_go_tools.sh @@ -31,5 +31,6 @@ $GOPATH/bin/gometalinter --install # gopls is generally recommended over community tools. # It's much faster and more reliable than the other options. -go get -u golang.org/x/tools/cmd/gopls +# 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 +GO111MODULE=on go get golang.org/x/tools/gopls@latest diff --git a/internal/codeserver/download.go b/internal/codeserver/download.go index b1cb3a1..8c73811 100644 --- a/internal/codeserver/download.go +++ b/internal/codeserver/download.go @@ -20,8 +20,8 @@ func DownloadURL(ctx context.Context) (string, error) { return "", xerrors.Errorf("failed to get latest code-server release: %w", err) } for _, v := range rel.Assets { - // TODO: fix this jank. - if strings.Index(*v.Name, "linux") < 0 { + // TODO: fix this jank, detect container architecture instead of hardcoding to x86_64 + if strings.Index(*v.Name, "linux-x86_64") < 0 { continue } return *v.BrowserDownloadURL, nil diff --git a/runner.go b/runner.go index 4857447..0cf0567 100644 --- a/runner.go +++ b/runner.go @@ -169,9 +169,10 @@ cd %v # This is necessary in case the .vscode directory wasn't created inside the container, as mounting to the host # extension dir will create it as root. sudo chown user:user ~/.vscode -code-server --host %v --port %v \ - --data-dir ~/.config/Code --extensions-dir %v --extra-extensions-dir ~/.vscode/extensions --allow-http --no-auth 2>&1 | tee %v -`, projectDir, containerAddr, containerPort, hostExtensionsDir, containerLogPath) +/usr/bin/code-server --host %v --port %v --user-data-dir ~/.config/Code --extensions-dir %v --extra-extensions-dir ~/.vscode/extensions --auth=none \ +--allow-http 2>&1 | tee %v`, + projectDir, containerAddr, containerPort, hostExtensionsDir, containerLogPath) + if r.testCmd != "" { cmd = r.testCmd + "\n exit 1" }