From bbbbe32b10483626453e2ceac41f2eaaabd5077c Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 15 Feb 2022 17:48:55 +0000 Subject: [PATCH] devcontainer: adapt to composer Make the devcontainer more complete for osbuild-composer by installing more dependencies and plugins. This enables golang and github integration by default. --- .devcontainer/Dockerfile | 38 +++++++++++++++++++++++---------- .devcontainer/devcontainer.json | 5 +++-- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 130bf7231..0aeedfeee 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,17 +1,33 @@ -FROM fedora:34 +FROM fedora:35 -# Install few packages for convenient usage. -# Inspired by the devcontainer in osbuild. +# Install: +# - a few packages for convenient usage +# - RPM tooling +# - the go compiler +# - weldr-client to use the weldr API +# - builddep to be able to pull in requirements from .spec RUN dnf install -y \ fish \ fd-find \ ripgrep \ - jq -# We build composer using RPM, install the tooling -RUN dnf install fedora-packager rpmdevtools go-srpm-macros -y -# The list of requirements is specified in the spec file. -# To install them, dnf needs the "builddep" command. -RUN dnf install 'dnf-command(builddep)' -y -# Copy the specfile and install the dependencies. -COPY osbuild-composer.spec /tmp/osbuild-composer.spec + jq \ + fedora-packager \ + rpmdevtools \ + go-srpm-macros \ + go \ + weldr-client \ + osbuild \ + osbuild-lvm2 \ + osbuild-luks2 \ + osbuild-ostree \ + osbuild-tools \ + 'dnf-command(builddep)' +# install the language server +RUN go install -v golang.org/x/tools/gopls@latest +RUN go install -v github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest +RUN go install -v github.com/ramya-rao-a/go-outline@latest +RUN go install -v github.com/go-delve/delve/cmd/dlv@latest +RUN go install -v honnef.co/go/tools/cmd/staticcheck@latest +COPY ./osbuild-composer.spec /tmp/osbuild-composer.spec RUN dnf builddep /tmp/osbuild-composer.spec -y +RUN rm /tmp/osbuild-composer.spec diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0c5667389..42e780a20 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ComposerBuilder", + "name": "composer", "build": { "dockerfile": "Dockerfile", "context": ".." @@ -12,6 +12,7 @@ ], "extensions": [ "laurenttreguier.rpm-spec", - "golang.Go" + "golang.Go", + "GitHub.vscode-pull-request-github" ] } \ No newline at end of file