Skip to content

Commit 0e3e7e5

Browse files
committed
fix: devcontainer 실행 이후에 onCreateCommand로 설정
- initializeCommand는 빌드 이전에 실행되어 go 사용 불가능 - 컨테이너 시작 첫번째 단계에서 필요한 설정 적용
1 parent 60a67bb commit 0e3e7e5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "iris-devcontainer",
3-
"dockerComposeFile": ["docker-compose.yml"],
3+
"dockerComposeFile": [
4+
"docker-compose.yml"
5+
],
46
"service": "iris-dev",
57
"workspaceFolder": "/app/src",
6-
"initializeCommand": "go install -v golang.org/x/tools/gopls@latest; go install -v github.com/ramya-rao-a/go-outline@latest",
7-
"postCreateCommand": "git config --global --add safe.directory /app/src",
8+
"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",
89
"customizations": {
910
// Configure properties specific to VS Code.
1011
"vscode": {
@@ -18,4 +19,4 @@
1819
]
1920
}
2021
}
21-
}
22+
}

Dockerfile-dev

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
3838
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
3939

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

0 commit comments

Comments
 (0)