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.
This commit is contained in:
Tom Gundersen 2022-02-15 17:48:55 +00:00
parent fc4b50e9db
commit bbbbe32b10
2 changed files with 30 additions and 13 deletions

View file

@ -1,17 +1,33 @@
FROM fedora:34 FROM fedora:35
# Install few packages for convenient usage. # Install:
# Inspired by the devcontainer in osbuild. # - 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 \ RUN dnf install -y \
fish \ fish \
fd-find \ fd-find \
ripgrep \ ripgrep \
jq jq \
# We build composer using RPM, install the tooling fedora-packager \
RUN dnf install fedora-packager rpmdevtools go-srpm-macros -y rpmdevtools \
# The list of requirements is specified in the spec file. go-srpm-macros \
# To install them, dnf needs the "builddep" command. go \
RUN dnf install 'dnf-command(builddep)' -y weldr-client \
# Copy the specfile and install the dependencies. osbuild \
COPY osbuild-composer.spec /tmp/osbuild-composer.spec 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 dnf builddep /tmp/osbuild-composer.spec -y
RUN rm /tmp/osbuild-composer.spec

View file

@ -1,5 +1,5 @@
{ {
"name": "ComposerBuilder", "name": "composer",
"build": { "build": {
"dockerfile": "Dockerfile", "dockerfile": "Dockerfile",
"context": ".." "context": ".."
@ -12,6 +12,7 @@
], ],
"extensions": [ "extensions": [
"laurenttreguier.rpm-spec", "laurenttreguier.rpm-spec",
"golang.Go" "golang.Go",
"GitHub.vscode-pull-request-github"
] ]
} }