Skip to content

Commit

Permalink
PoC for codespaces configuration
Browse files Browse the repository at this point in the history
    Gitub Codespaces are dev environment within the browser.
    They provides VM and in browser preconfigured VSCode.
    The idea here is to define a preconfigured codespaces that
    is targeting os-autoinst-distri-opensuse developers.
    The VM image is configured by a Dockerfile and a script.
    The environment is based on openSUSE TW. The image has packages suggested in
    CONTRIBUTING.md plus other packages that are needed be able to run `make tests`.
    The image is provided with non-root user `node`.
    The proposed configuration also provide some pre-installed VSCode
    plugins.
  • Loading branch information
mpagot committed Dec 15, 2023
1 parent f6c1671 commit a5f61ae
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use the specified image
FROM registry.opensuse.org/opensuse/tumbleweed:latest

ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID

#RUN useradd podman; \
#echo podman:10000:5000 > /etc/subuid; \
#echo podman:10000:5000 > /etc/subgid;

# Create the user
#RUN groupadd --gid $USER_GID $USERNAME
#RUN useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
# && chmod 0440 /etc/sudoers.d/$USERNAME

# Copy the script into the image
COPY install-dependencies.sh /tmp/install-dependencies.sh

# Run the script
RUN /tmp/install-dependencies.sh

# Set the default user
#USER $USERNAME
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"build": { "dockerfile": "Dockerfile" },
"features": {
},
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
"richterger.perl",
"ms-python.python",
"sfodje.perltidy",
"ms-vscode.makefile-tools"
]
}
},
"postCreateCommand": "make prepare",
"remoteUser": "user-name-goes-here",
}
8 changes: 8 additions & 0 deletions .devcontainer/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generic update
zypper dup -y

# dependency suggested in the CONTRIBUTING.md
zypper in -y os-autoinst-distri-opensuse-deps perl-JSON-Validator gnu_parallel

# other dependency that are needed
zypper in -y make git vim gcc-c++ libxml2-devel libssh2-devel libexpat-devel dbus-1-devel python311 python311-devel python311-yamllint python311-PyYAML perl-App-cpanminus perl-Code-TidyAll podman

0 comments on commit a5f61ae

Please sign in to comment.