Skip to content

Commit

Permalink
Create a custom docker network for the devcontainers (#2341)
Browse files Browse the repository at this point in the history
* Create a custom docker network for the devcontainer

* Get rid of Octant; not working and we replaced with k9s

* Adding ping utility
  • Loading branch information
jimleroyer authored Nov 4, 2024
1 parent e3abcde commit 23e62c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
8 changes: 1 addition & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.10@sha256:ef9cc483a593c95e1e83f2cf00b6a0e1ec7df43344416a41ccb3a88aef27beac

ARG KUBENS_VERSION="0.9.4"
ARG OCTANT_VERSION="0.25.1"
ENV POETRY_VERSION="1.7.1"

# Install packages
Expand All @@ -18,6 +17,7 @@ RUN apt-get update \
fd-find \
git \
iproute2 \
iputils-ping \
less \
libsodium-dev \
lsb-release \
Expand Down Expand Up @@ -55,12 +55,6 @@ RUN git clone -b v${KUBENS_VERSION} --single-branch https://github.com/ahmetb/ku
&& ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx \
&& ln -s /opt/kubectx/kubens /usr/local/bin/kubens

# Install Octant
RUN curl -Lo octant.tar.gz https://github.com/vmware-tanzu/octant/releases/download/v${OCTANT_VERSION}/octant_${OCTANT_VERSION}_Linux-64bit.tar.gz \
&& tar -xvf octant.tar.gz \
&& mv octant_${OCTANT_VERSION}_Linux-64bit/octant /usr/local/bin/ \
&& rm -rf octant_${OCTANT_VERSION}_Linux-64bit

COPY .devcontainer/scripts/notify-dev-entrypoint.sh /usr/local/bin/

ENV SHELL /bin/zsh
Expand Down
11 changes: 3 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "notification-api",
"dockerComposeFile": "docker-compose.yml",
"service": "dev",
"service": "notify-api",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"remoteEnv": {
Expand Down Expand Up @@ -47,19 +47,14 @@
},
"features": {
"docker-from-docker": {
"version": "latest",
"moby": true
},
"kubectl-helm-minikube": {
"version": "latest",
"helm": "latest",
"minikube": "none"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "14.17.4"
}
"ghcr.io/devcontainers/features/node:1": {}
},
"postCreateCommand": "notify-dev-entrypoint.sh",
"remoteUser": "vscode",

"remoteUser": "vscode"
}
15 changes: 14 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'

services:
dev:
notify-api:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
Expand All @@ -18,6 +18,10 @@ services:
- 6011:6011
links:
- db
expose:
- "6011"
networks:
- notify-network

db:
image: postgres:11.22-bullseye@sha256:c886a3236b3d11abc302e64309186c90a69b49e53ccff23fd8c8b057b5b4bce9
Expand All @@ -36,6 +40,8 @@ services:
- "5432"
ports:
- "5432:5432"
networks:
- notify-network

redis:
image: redis:6.2@sha256:7919fdd5300e7abf7ae95919e6f144b37c55df16553302dbbcc7495a5aa0c079
Expand All @@ -45,3 +51,10 @@ services:
- "6380:6380"
expose:
- "6380"
networks:
- notify-network

networks:
notify-network:
name: notify-network
driver: bridge

0 comments on commit 23e62c3

Please sign in to comment.