Skip to content

Commit b802747

Browse files
author
Blink
committed
refactor: make Red Hat UBI9 image minimal like Ubuntu base
- Simplified Dockerfile to match Ubuntu base image pattern - Removed multi-stage builds and extensive tooling - Kept only essential packages: Docker, Git, Python, development tools - Updated README to reflect minimal base image approach - Image now serves as extensible base rather than comprehensive environment - Follows coder/images repository conventions for base images
1 parent e9bd41d commit b802747

File tree

2 files changed

+92
-236
lines changed

2 files changed

+92
-236
lines changed

images/redhat-ubi9/README.md

Lines changed: 51 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,42 @@
1-
# Red Hat UBI9 Development Image
1+
# Red Hat UBI9 Base Image
22

3-
A comprehensive development workspace image based on Red Hat Universal Base Image 9 (UBI9) for use with Coder.
3+
[![Docker Pulls](https://img.shields.io/docker/pulls/codercom/enterprise-redhat-ubi9?label=codercom%2Fenterprise-redhat-ubi9)](https://hub.docker.com/r/codercom/enterprise-redhat-ubi9)
4+
5+
## Description
6+
7+
A minimal base image based on Red Hat Universal Base Image 9 (UBI9) for use with Coder workspaces. This image provides enterprise-grade security and compliance while maintaining a minimal footprint.
48

59
## Features
610

711
### Base Operating System
812
- **Red Hat UBI9**: Enterprise-grade, security-focused base image
913
- **Enterprise Ready**: Red Hat supported with regular security updates
1014
- **Compliance**: Meets enterprise security and compliance requirements
15+
- **Minimal**: Only essential packages included
1116

12-
### Development Tools
17+
### Included Tools
1318

14-
#### Languages & Runtimes
15-
- **Go 1.24.2**: Latest Go version with complete toolchain
16-
- **Node.js 20**: Latest LTS with npm and pnpm
17-
- **Python 3**: System Python with pip
18-
- **Rust**: Latest stable with Cargo
19-
20-
#### Go Development Tools
21-
- `gopls` - Go language server
22-
- `goimports` - Import management
23-
- `moq` - Mock generation
24-
- `swag` - Swagger documentation
25-
- `swagger` - API client generation
26-
- `migrate` - Database migrations
27-
- `goreleaser` - Release automation
28-
- `gotestsum` - Enhanced test output
29-
- `kind` - Kubernetes in Docker
30-
- `helm-docs` - Helm documentation
31-
- `sqlc` - SQL code generation
32-
- `ruleguard` - Custom linting rules
33-
- `shfmt` - Shell script formatting
34-
- `nfpm` - Package building
35-
- `yq` - YAML processing
36-
- `mockgen` - Interface mocking
37-
38-
#### Infrastructure & DevOps
19+
#### Essential Development Tools
20+
- **Development Tools**: GCC, make, and essential build tools
3921
- **Docker CE**: Container development and deployment
40-
- **Terraform**: Infrastructure as Code
41-
- **kubectl**: Kubernetes command-line tool
42-
- **Helm**: Kubernetes package manager
43-
44-
#### Development Utilities
4522
- **Git**: Version control
23+
- **Python 3**: System Python with pip
24+
- **Bash**: Default shell
25+
26+
#### System Utilities
27+
- **curl/wget**: HTTP clients
4628
- **jq**: JSON processing
4729
- **htop**: Process monitoring
48-
- **tmux**: Terminal multiplexer
49-
- **vim/nano**: Text editors
50-
- **fish/zsh/bash**: Multiple shell options
51-
- **pre-commit**: Git hooks framework
52-
53-
#### Rust Tools
54-
- `jj-cli` - Jujutsu version control
55-
- `typos-cli` - Spell checker
56-
- `watchexec-cli` - File watcher
57-
58-
#### Protocol Buffers
59-
- `protoc` - Protocol buffer compiler
60-
- Go protobuf plugins
30+
- **vim**: Text editor
31+
- **unzip**: Archive extraction
32+
- **rsync**: File synchronization
33+
- **systemd**: System and service manager
6134

6235
## Usage
6336

6437
### With Coder Templates
6538

66-
Use this image in your Coder workspace templates:
39+
Use this image as a base in your Coder workspace templates:
6740

6841
```hcl
6942
resource "docker_image" "main" {
@@ -79,6 +52,24 @@ resource "docker_container" "workspace" {
7952
}
8053
```
8154

55+
### Extending This Image
56+
57+
Extend this image with additional tooling and language packages:
58+
59+
```dockerfile
60+
FROM codercom/enterprise-redhat-ubi9
61+
62+
# Install Go
63+
RUN curl -L "https://go.dev/dl/go1.24.2.linux-amd64.tar.gz" | tar -C /usr/local -xz
64+
ENV PATH=/usr/local/go/bin:$PATH
65+
66+
# Install Node.js
67+
RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \
68+
dnf install -y nodejs
69+
70+
# Add your tools here
71+
```
72+
8273
### Building Locally
8374

8475
```bash
@@ -89,57 +80,44 @@ docker build -f ubi9.Dockerfile -t coder-redhat-ubi9 .
8980
docker run -it --rm coder-redhat-ubi9
9081
```
9182

83+
## How To Use It
84+
85+
Extend this image with additional tooling and language packages.
86+
9287
### Environment Variables
9388

9489
The image sets up the following environment:
9590

96-
- `GOPATH=/home/coder/go`
97-
- `GOROOT=/usr/local/go`
98-
- `PATH` includes Go, Node.js, and all development tools
9991
- `LANG=en_US.UTF-8`
92+
- `LANGUAGE=en_US.UTF-8`
10093
- `LC_ALL=en_US.UTF-8`
10194

10295
### User Configuration
10396

10497
- **User**: `coder` (non-root)
10598
- **Home**: `/home/coder`
106-
- **Shell**: bash (with zsh and fish available)
99+
- **Shell**: bash
107100
- **Sudo**: Passwordless sudo access
108-
109-
### Ports
110-
111-
The following ports are exposed for development:
112-
113-
- `3000` - Frontend development servers
114-
- `8080` - Backend services
115-
- `8443` - HTTPS services
101+
- **Groups**: docker (for Docker access)
116102

117103
## Use Cases
118104

119-
This image is ideal for:
105+
This base image is ideal for:
120106

121-
- **Go Development**: Complete Go development environment
122-
- **Full-Stack Development**: Go backend + Node.js frontend
123-
- **Cloud Native Development**: Kubernetes and container development
124-
- **Infrastructure Development**: Terraform and DevOps workflows
125107
- **Enterprise Environments**: Red Hat compliance and support
126-
- **Multi-language Projects**: Go, Node.js, Python, Rust support
108+
- **Container Development**: Docker and containerized applications
109+
- **Custom Development Images**: Extend with specific language runtimes
110+
- **Security-Conscious Deployments**: Minimal attack surface
111+
- **Compliance Requirements**: Red Hat enterprise support
127112

128113
## Security & Compliance
129114

130115
- Based on Red Hat UBI9 for enterprise security
131116
- Regular security updates from Red Hat
132117
- Non-root user execution
133-
- Minimal attack surface with curated tool selection
118+
- Minimal package installation
134119
- Compliance with enterprise security policies
135120

136-
## Size Optimization
137-
138-
- Multi-stage build to minimize final image size
139-
- Package cache cleanup
140-
- Optimized layer structure
141-
- Only essential development tools included
142-
143121
## Support
144122

145123
For issues related to:

0 commit comments

Comments
 (0)