Non-IDE dev container

You can configure a non-IDE dev container to run background tasks, such as CI/CD pipelines or Code Genie automation, without the overhead of an IDE.

A non-IDE dev container runs as a plain container without launching an IDE. It launches faster and occupies less resources than a standard dev container, making it suitable for background tasks that run without user interaction - such as PR automation, CI/CD pipelines, or CLI-only workloads, where including an IDE would be unnecessary overhead.

You can configure one by setting the "ide": "false" property in your devcontainer.json file. The following devcontainer.json file shows a sample configuration for a non-IDE dev container:

{
  "name": "My Dev Container",
  "description": "A plain development container without IDE support.",
  "build": {
    "dockerfile": "Dockerfile"
  },
  "ide": "false",
  "image": "<username>/<container-name>:<tag>"
}

You can use a non-IDE dev container with Code Genie to improve performance. When a PR is created, Code Genie launches a dev container in the background. Excluding the IDE minimizes startup time and resource consumption, resulting in faster, more lightweight automation.

The following Dockerfile shows a sample configuration for a non-IDE dev container with the IDE installation removed:

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y \
        sudo \
        curl \
        git \
        ca-certificates \
        build-essential && \
    apt-get clean

RUN chmod -R ug+w /etc/pki/ca-trust/source /etc/pki/ca-trust/extracted || true

RUN useradd -m -u 1001 devuser
USER 1001
WORKDIR /home/1001
CMD ["tail", "-f", "/dev/null"]

Configuring the timeout for non-IDE dev containers

DevOps Loop automatically terminates idle non-IDE dev containers if not in use after a configurable timeout period.

The timeout value is specified in seconds and can be configured during installation.

For example, to set the timeout to 86,400 seconds (24 hours), add the following to the Loop installation script:
NON_IDE_CONTAINER_TIMEOUT=86400

if [ -n "${NON_IDE_CONTAINER_TIMEOUT}" ]; then
 HELM_OPTIONS="${HELM_OPTIONS} --set global.nonIdeContainerTimeout=${NON_IDE_CONTAINER_TIMEOUT}"
fi