Sign inSign up

vishal210893/act-env

By vishal210893

•Updated about 1 year ago

Docker Multi-Tool Development Environment for ACT (local GitHub action)

Image
Developer tools
0

157

vishal210893/act-env repository overview

⁠🐳 Docker Multi-Tool Development Environment

⁠Overview

This Docker image creates a comprehensive development environment based on Ubuntu 22.04, packed with essential tools for modern software development, testing, and deployment. It's designed to support Go development, testing with Ginkgo, containerization workflows, and Kubernetes operations.

⁠🛠️ Included Tools & Technologies

⁠Core Development Stack
  • Go 1.23.8 - Primary programming language with full toolchain
  • Node.js 20 - JavaScript runtime for modern web development
  • Java 17 - OpenJDK for Java-based applications
  • Python 3.x - With pip and development headers
⁠Testing Framework
  • Ginkgo v2.24.0 - BDD testing framework for Go
  • Gomega - Matcher library (installed with Ginkgo)
⁠Container & Orchestration Tools
  • Docker Engine - Full Docker daemon with CLI and Compose plugin
  • kubectl - Kubernetes command-line tool (latest stable)
  • Helm 3.x - Kubernetes package manager
  • k3d - Lightweight Kubernetes in Docker
⁠System Utilities
  • Git, Make, GCC, JQ, Unzip
  • CA certificates with proper updates
  • Build essentials for compilation

⁠🏗️ Architecture Features

  • Multi-architecture support: AMD64 and ARM64
  • Proxy-aware: Supports HTTP/HTTPS proxy configuration
  • Optimized layers: Efficient caching and minimal image size
  • Production-ready: Proper certificate handling and security considerations

⁠📁 Environment Configuration

# Go Configuration
GOPATH=/go
GOBIN=/go/bin
PATH=/usr/local/go/bin:/go/bin:$PATH

# Java Configuration  
JAVA_HOME=/usr/lib/jvm/java-17-openjdk
PATH=$JAVA_HOME/bin:$PATH

# Proxy Support (build-time)
HTTP_PROXY, HTTPS_PROXY, NO_PROXY

⁠🚀 Use Cases

This Docker image is perfect for:

  • Go microservices development with comprehensive testing
  • Cloud-native application development with Kubernetes tooling
  • CI/CD pipelines requiring multiple language support
  • Development environments that need Docker-in-Docker capabilities
  • Educational purposes for learning modern DevOps practices

⁠📋 Complete Dockerfile

FROM ubuntu:22.04

# -----------------------------
# Versions & base environment
# -----------------------------
ENV DEBIAN_FRONTEND=noninteractive
ENV GO_VERSION=1.23.8
ENV NODE_VERSION=20
ENV JAVA_VERSION=17
ENV GINKGO_VERSION=v2.24.0

# Runtime env
ENV GOPATH=/go
ENV GOBIN=$GOPATH/bin
ENV PATH=/usr/local/go/bin:$GOBIN:$PATH

# Optional proxy passthrough (build-time)
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV http_proxy=$HTTP_PROXY
ENV https_proxy=$HTTPS_PROXY
ENV no_proxy=$NO_PROXY

# ---------------------------------------------
# Base deps (lean) + make sure CA certs are set + sudo
# ---------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
      ca-certificates curl wget gnupg git sudo \
      python3 python3-pip python3-dev \
      build-essential make gcc jq unzip \
  && update-ca-certificates \
  && rm -rf /var/lib/apt/lists/*

# -----------------
# Install Go (arch-aware, no checksum)
# -----------------
RUN set -eux; \
    arch="$(dpkg --print-architecture)"; \
    case "$arch" in amd64|arm64) ;; *) echo "unsupported architecture: $arch" >&2; exit 1 ;; esac; \
    wget -4 -O /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz"; \
    tar -C /usr/local -xzf /tmp/go.tgz; rm -f /tmp/go.tgz; \
    mkdir -p "$GOPATH/src" "$GOPATH/bin"

# ----------------------------
# Install Ginkgo & Gomega lean
# (use temp GOPATH, place binaries in /usr/local/bin, then clean)
# ----------------------------
RUN set -eux; \
    export GOPATH=/tmp/gopath GOBIN=/usr/local/bin; \
    go install github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}; \
    go version; \
    go clean -modcache; \
    rm -rf /tmp/gopath

# -----------------
# Docker Engine (DinD tools)
# -----------------
# NOTE: If you don't need the daemon, you can install only docker-ce-cli + docker-compose-plugin to save ~300–400MB
RUN set -eux; \
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg; \
  . /etc/os-release; \
  echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list; \
  apt-get update && apt-get install -y --no-install-recommends \
    docker-ce docker-ce-cli containerd.io docker-compose-plugin \
  && rm -rf /var/lib/apt/lists/*

# --------
# Node.js 20
# --------
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
    apt-get install -y --no-install-recommends nodejs && \
    rm -rf /var/lib/apt/lists/*

# ----
# Java
# ----
RUN apt-get update && apt-get install -y --no-install-recommends \
      openjdk-${JAVA_VERSION}-jdk \
  && rm -rf /var/lib/apt/lists/* \
  && ln -sf "/usr/lib/jvm/java-${JAVA_VERSION}-openjdk-$(dpkg --print-architecture)" "/usr/lib/jvm/java-${JAVA_VERSION}-openjdk"
ENV JAVA_HOME=/usr/lib/jvm/java-${JAVA_VERSION}-openjdk
ENV PATH=$JAVA_HOME/bin:$PATH

# -----------------------------
# Kubernetes tools (kubectl/helm)
# -----------------------------
RUN set -eux; \
    arch="$(dpkg --print-architecture)"; \
    curl -fsSLo /usr/local/bin/kubectl "https://dl.k8s.io/release/$(curl -fsSL https://dl.k8s.io/release/stable.txt)/bin/linux/${arch}/kubectl"; \
    chmod +x /usr/local/bin/kubectl; \
    curl -fsSL -o /tmp/get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3; \
    chmod 700 /tmp/get_helm.sh; /tmp/get_helm.sh; rm /tmp/get_helm.sh

# ----
# k3d
# ----
RUN curl -fsSL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash

# ---------------------
# Final cleanup (caches)
# ---------------------
RUN set -eux; \
    # npm/pip/go caches
    npm cache clean --force || true; rm -rf /root/.npm || true; \
    pip cache purge || true; \
    go clean -cache -testcache || true; \
    # docs/manpages/locales (optional but helps)
    rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/info/* /var/cache/* /root/.cache/*

# ---------------------
# Verify installations
# ---------------------
RUN go version && \
    ginkgo version && \
    node --version && \
    npm --version && \
    java -version && \
    python3 --version && \
    git --version && \
    docker --version && \
    kubectl version --client && \
    helm version && \
    k3d version && \
    sudo --version

CMD ["/bin/bash"]

⁠💡 Optimization Notes

  • Layer optimization: Each major component is installed in separate layers for better caching
  • Cleanup strategy: Aggressive cache cleaning reduces final image size
  • Security: CA certificates are properly updated and GPG keys are used for package verification
  • Flexibility: Proxy support allows use in corporate environments
  • Verification: All tools are tested during build to ensure proper installation

⁠📊 Image Characteristics

  • Base: Ubuntu 22.04 LTS
  • Architecture: Multi-arch (AMD64/ARM64)
  • Estimated Size: ~2-3GB (depending on architecture)
  • Security: Regularly updated base packages with proper certificate handling

Tag summary

Content type

Image

Digest

sha256:b24e12341…

Size

638.2 MB

Last updated

about 1 year ago

docker pull vishal210893/act-env:3