From 81d1db57ccf78e8462507586fbd96a75c1b1daf9 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Tue, 23 Jul 2024 19:51:46 -0400 Subject: [PATCH] node: devcontainer support --- .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ node/Dockerfile | 4 +++- scripts/check-docker-pin.sh | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..d8eeaf306 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "Guardian Development", + "build": { + "context": "..", + "dockerfile": "../node/Dockerfile", + "target": "dev" + }, + "customizations": { + "vscode": { + "extensions": [ + "golang.go", + "ms-azuretools.vscode-docker", + "ms-vscode.makefile-tools" + ], + "settings": { + "files.insertFinalNewline": true + } + } + }, +} diff --git a/node/Dockerfile b/node/Dockerfile index 6a82f3e39..2f081d50d 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,7 +1,9 @@ # syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 -FROM --platform=linux/amd64 docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS build +FROM --platform=linux/amd64 docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS dev # libwasmvm.so is not compatible with arm +FROM dev AS build + WORKDIR /app COPY node/tools tools diff --git a/scripts/check-docker-pin.sh b/scripts/check-docker-pin.sh index b2f45f557..9c2eb96b1 100755 --- a/scripts/check-docker-pin.sh +++ b/scripts/check-docker-pin.sh @@ -13,7 +13,7 @@ # - We ignore cosmwasm_artifacts AS artifacts because it's a local reference only, is built in tilt # - We ignore base AS (ignite-go-build|ignite-vue-build) because the base image is already pinned in wormchain/Dockerfile.proto # -git ls-files -z | grep -z "Dockerfile*" | xargs -r -0 grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts|cli-gen|const-gen AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-vue-build|cli-export|const-export)' +git ls-files -z | grep -z "Dockerfile*" | xargs -r -0 grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts|cli-gen|const-gen|dev AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-vue-build|cli-export|const-export|build)' if [ $? -eq 0 ]; then echo "[!] Unpinned docker files" >&2 exit 1