Skip to content

Commit

Permalink
added protobuf and changed workspace path for devcontainer (dapr#1500)
Browse files Browse the repository at this point in the history
Co-authored-by: Young Bu Park <youngp@microsoft.com>
  • Loading branch information
jjcollinge and youngbupark authored May 1, 2020
1 parent ae8f85d commit 39cf0fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Update container version when you update dev-container
"image": "docker.io/daprio/dapr-dev:0.1.1",
// Uncomment if you want to use your local docker image
// "dockerFile": "../docker/Dockerfile-dev",
//"dockerFile": "../docker/Dockerfile-dev",
"runArgs": [
// On Linux, this will prevent new files getting created as root, but you
// may need to update the USER_UID and USER_GID in docker/Dockerfile-dev
Expand All @@ -26,6 +26,8 @@
"terminal.integrated.shell.linux": "/bin/bash",
"go.gopath": "/go"
},
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/go/src/github.com/dapr",
"workspaceFolder": "/go/src/github.com/dapr",
"extensions": [
"ms-vscode.go",
"ms-azuretools.vscode-docker",
Expand Down
20 changes: 18 additions & 2 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ RUN mkdir -p /tmp/gotools \
github.com/sqs/goreturns@latest \
github.com/josharian/impl@latest \
github.com/davidrjenni/reftools/cmd/fillstruct@latest \
github.com/uudashr/gopkgs/cmd/gopkgs@latest \
github.com/ramya-rao-a/go-outline@latest \
github.com/acroca/go-symbols@latest \
github.com/godoctor/godoctor@latest \
Expand All @@ -60,6 +59,9 @@ RUN mkdir -p /tmp/gotools \
github.com/fatih/gomodifytags@latest \
github.com/mgechev/revive@latest \
github.com/go-delve/delve/cmd/dlv@latest 2>&1 \
&& GO111MODULE=off go get -v github.com/uudashr/gopkgs/cmd/gopkgs \
# Install Go protoc gen
&& go get github.com/golang/protobuf/protoc-gen-go \
#
# Install Go tools w/o module support
&& go get -v github.com/alecthomas/gometalinter 2>&1 \
Expand All @@ -72,6 +74,19 @@ RUN mkdir -p /tmp/gotools \
# Install golangci-lint
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin 2>&1

# Install protobuf
RUN apt-get install autoconf automake libtool curl make g++ unzip -y \
&& git clone https://github.com/google/protobuf.git \
&& cd protobuf \
&& git checkout v3.11.0 \
&& git submodule update --init --recursive \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make check \
&& make install \
&& ldconfig

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand All @@ -85,7 +100,8 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /go/src

RUN chmod 777 -R /go
RUN chmod 777 -R /go \
&& mkdir -p /go/src/github.com/dapr

# switch to USERNAME
USER $USERNAME
Expand Down

0 comments on commit 39cf0fa

Please sign in to comment.