Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for devcontainers #11634

Open
wants to merge 7 commits into
base: rpm/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"build": {
"dockerfile": "../Containerfile",
"context": "."
},
"customizations": {
"vscode": {
"extensions": ["ian-h-chamberlain.rpm-specfile"]
}
},
"runArgs": [
"--privileged",
"--platform=linux/amd64"
],
// When using podman instead of docker, uncomment the next line and follow to configure your editor https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman
// "remoteUser": "root",
"workspaceFolder": "/opt/foreman-packaging",
"workspaceMount": "source=${localWorkspaceFolder},target=/opt/foreman-packaging,type=bind,consistency=cached"
}
9 changes: 7 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/centos/centos:stream9
FROM --platform=linux/amd64 quay.io/centos/centos:stream9

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
Expand All @@ -12,10 +12,15 @@ RUN echo "[git-annex]" >> /etc/yum.repos.d/git-annex.repo \

RUN dnf -y module enable nodejs:18

RUN dnf -y install nodejs vim git rpmdevtools git-annex-standalone wget ruby jq ruby-devel make gcc-c++ postgresql-devel libxml2-devel libcurl-devel systemd-devel \
RUN dnf install -y epel-release && \
dnf -y install nodejs vim git rpmdevtools git-annex-standalone wget ruby jq ruby-devel make gcc-c++ mock postgresql-devel libxml2-devel libcurl-devel systemd-devel rpmlint \
python3 python3-pip python3-ruamel-yaml python3-requests python3-packaging

RUN npm install npm2rpm --global

RUN gem install gem2rpm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprisingly this isn't in EPEL according to https://src.fedoraproject.org/rpms/rubygem-gem2rpm.


RUN pip3 install rpmspectool obal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also surprises me rpmspectool isn't in EPEL (https://src.fedoraproject.org/rpms/rpmspectool). Almost makes me think people typically use Fedora to develop ;)


RUN mkdir -p /opt/foreman-packaging
WORKDIR /opt/foreman-packaging