Skip to content

Commit

Permalink
chore: fix devcontainer for development (#1008)
Browse files Browse the repository at this point in the history
* chore: fix devcontainer for development

Signed-off-by: Kenta Kozuka <[email protected]>

* replace vendor with update-repos

Signed-off-by: Kenta Kozuka <[email protected]>

---------

Signed-off-by: Kenta Kozuka <[email protected]>
  • Loading branch information
kentakozuka authored Jun 12, 2024
1 parent e8c6659 commit 74406be
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go"
"go.gopath": "/go",
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--config=${workspaceFolder}/.golangci.yml",
"--fast"
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
Expand All @@ -26,5 +31,6 @@
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
}
},
"postAttachCommand": "make local-deps && make update-repos && (cd ui/web-v2 && yarn)"
}
16 changes: 7 additions & 9 deletions .github/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM ubuntu:focal
FROM ubuntu:jammy

COPY first-run-notice.txt /tmp/scripts/

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Restore man command
&& yes | unminimize 2>&1
&& yes | unminimize 2>&1

ENV LANG="C.UTF-8"

Expand All @@ -29,15 +29,13 @@ RUN apt-get update \
zip \
libgdiplus \
jq \
# By default pip is not available in the buildpacks image
python-pip-whl \
python3-pip \
#.NET Core related pre-requisites
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libncurses5 \
liblttng-ust0 \
liblttng-ust1 \
libssl-dev \
libstdc++6 \
zlib1g \
Expand All @@ -59,7 +57,7 @@ RUN apt-get update \

# Verify expected build and debug tools are present
RUN apt-get update \
&& apt-get -y install build-essential cmake cppcheck valgrind clang lldb llvm gdb python3-dev \
&& apt-get -y install build-essential cmake cppcheck valgrind clang clang-format lldb llvm gdb python3-dev \
# Install tools and shells not in common script
&& apt-get install -yq vim vim-doc xtail software-properties-common libsecret-1-dev \
# Install additional tools (useful for 'puppeteer' project)
Expand All @@ -78,7 +76,7 @@ ENV SHELL=/bin/bash \
# Remove scripts now that we're done with them
RUN apt-get clean -y && rm -rf /tmp/scripts

# Mount for docker-in-docker
# Mount for docker-in-docker
VOLUME [ "/var/lib/docker" ]

# Fire Docker/Moby script if needed
Expand All @@ -88,7 +86,7 @@ CMD [ "sleep", "infinity" ]
# [Optional] Install debugger for development of Codespaces - Not in resulting image by default
ARG DeveloperBuild
RUN if [ -z $DeveloperBuild ]; then \
echo "not including debugger" ; \
echo "not including debugger" ; \
else \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
fi
5 changes: 5 additions & 0 deletions .github/.devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"resolved": "ghcr.io/devcontainers/features/kubectl-helm-minikube@sha256:23aca9dfe058b498b4d7fa2d5592c75b1ff06e581b950419a56e19568d8ecaf7",
"integrity": "sha256:23aca9dfe058b498b4d7fa2d5592c75b1ff06e581b950419a56e19568d8ecaf7"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "1.4.1",
"resolved": "ghcr.io/devcontainers/features/node@sha256:6c4f444d8e3eb68594d60ec128bce76a80647edc2b9a94960ca377895855145f",
"integrity": "sha256:6c4f444d8e3eb68594d60ec128bce76a80647edc2b9a94960ca377895855145f"
},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "1.0.9",
"resolved": "ghcr.io/devcontainers/features/sshd@sha256:7f6467f25d23c47371ba59f6f3350c9de3439a4d4cdf7497ae50e8aca40bc0e0",
Expand Down
3 changes: 3 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"ghcr.io/devcontainers/features/go:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "latest"
},
"./local-features/setup-user": "latest"
},
"overrideFeatureInstallOrder": [
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,12 @@ update-copyright:
# dev container
#############################

# build devcontainer locally
build-devcontainer:
devcontainer build --workspace-folder=.github --push=false --image-name="ghcr.io/bucketeer-io/bucketeer-devcontainer:latest"

# start minikube
start-minikube:
start-minikube:
if [ $$(minikube status | grep -c "minikube start") -eq 1 ]; then \
make -C tools/dev setup-minikube; \
elif [ $$(minikube status | grep -c "Stopped") -gt 1 ]; then \
Expand Down

0 comments on commit 74406be

Please sign in to comment.