Skip to content

Commit

Permalink
fix: devcontainer 실행 이후에 onCreateCommand로 설정
Browse files Browse the repository at this point in the history
- initializeCommand는 빌드 이전에 실행되어 go 사용 불가능
- 컨테이너 시작 첫번째 단계에서 필요한 설정 적용
  • Loading branch information
cranemont committed Feb 21, 2023
1 parent 60a67bb commit 0e3e7e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "iris-devcontainer",
"dockerComposeFile": ["docker-compose.yml"],
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "iris-dev",
"workspaceFolder": "/app/src",
"initializeCommand": "go install -v golang.org/x/tools/gopls@latest; go install -v github.com/ramya-rao-a/go-outline@latest",
"postCreateCommand": "git config --global --add safe.directory /app/src",
"onCreateCommand": "go get -d && go install -v golang.org/x/tools/gopls@latest && go install -v github.com/ramya-rao-a/go-outline@latest && git config --global --add safe.directory /app/src",
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
Expand All @@ -18,4 +19,4 @@
]
}
}
}
}
2 changes: 0 additions & 2 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

WORKDIR $GOPATH/src
COPY . .
RUN go get -d
ENV APP_ENV=development

0 comments on commit 0e3e7e5

Please sign in to comment.