Skip to content

Commit

Permalink
fix: Devcontainer resets /etc/hosts (argoproj#11439)
Browse files Browse the repository at this point in the history
Signed-off-by: Byeonggon Lee <binkoni@gonnux.com>
  • Loading branch information
binkoni committed Jul 25, 2023
1 parent 34ffc87 commit eb618f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"runArgs": ["--add-host=host.docker.internal:host-gateway"],
"onCreateCommand": ".devcontainer/pre-build.sh",
"postStartCommand": ".devcontainer/post-start.sh",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/argoproj/argo-workflows,type=bind",
"workspaceFolder": "/home/vscode/go/src/github.com/argoproj/argo-workflows",
"remoteEnv": {
Expand Down
9 changes: 9 additions & 0 deletions .devcontainer/post-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
set -eux

# Add hosts
sudo bash -c 'echo "127.0.0.1 dex" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 minio" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 postgres" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 mysql" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 azurite" >> /etc/hosts'
7 changes: 0 additions & 7 deletions .devcontainer/pre-build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#!/usr/bin/env sh
set -eux

# Add hosts
sudo bash -c 'echo "127.0.0.1 dex" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 minio" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 postgres" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 mysql" >> /etc/hosts'
sudo bash -c 'echo "127.0.0.1 azurite" >> /etc/hosts'

# install kubernetes
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
k3d cluster get k3s-default || k3d cluster create --image rancher/k3s:v1.27.3-k3s1 --wait
Expand Down

0 comments on commit eb618f7

Please sign in to comment.