Sign inSign up

h4shelldocker/podman-environment

By h4shelldocker

•Updated over 1 year ago

Image
0

1.5K

h4shelldocker/podman-environment repository overview

⁠Podman Environment

A containerized environment that provides Podman capabilities within a Docker container, designed for development and testing purposes.

⁠Features

  • Podman & Podman Compose: Full Podman container management capabilities
  • SSH Access: Remote access via SSH on port 2222
  • Development Tools: Git, curl, nano, sudo pre-installed
  • Alpine Linux Base: Lightweight and secure base image
  • Privileged Mode: Required for container-in-container operations

⁠Quick Start

⁠Running the Container
docker run -d \
  --name podman-environment \
  --privileged \
  --hostname podman-environment \
  --volume home:/root \
  --cgroup-parent docker.slice \
  -p 2222:22 \
  docker.io/h4shelldocker/podman-environment
⁠SSH Access

Once the container is running, you can access it via SSH:

ssh -p 2222 root@localhost

Default Credentials:

  • Username: root
  • Password: password

For improved security and convenience, you can set up SSH key authentication:

# Copy your SSH public key to the container
ssh-copy-id -p 2222 root@localhost

After setting up SSH keys, you can connect without entering the password each time.

⁠VS Code Integration

You can use this environment directly in VS Code with the Remote Explorer plugin for seamless development.

⁠SSH Configuration

Add the following configuration to your SSH config file ($HOME/.ssh/config):

Host podman-environment
    HostName localhost
    User root
    Port 2222
⁠VS Code Remote Development
  1. Install Remote Explorer Extension: Install the "Remote - SSH" extension in VS Code
  2. Connect to Environment:
    • Open VS Code
    • Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
    • Type "Remote-SSH: Connect to Host"
    • Select podman-environment from the list
  3. Development: VS Code will connect to the container and you can develop directly in the Podman environment
⁠Benefits of VS Code Integration
  • Direct Development: Work directly in the containerized environment
  • Podman Integration: Full access to Podman commands and containers
  • Persistent Workspace: Files are saved in the mounted volume
  • Extension Support: Install VS Code extensions in the remote environment

⁠Container Architecture

⁠Base Image
  • FROM: docker.io/alpine:latest
  • Lightweight Alpine Linux distribution
⁠Installed Packages
  • podman - Container engine
  • podman-compose - Docker Compose equivalent for Podman
  • cgroup-tools - Control group utilities
  • iptables - Network packet filtering
  • openssh-server - SSH server for remote access
  • git - Version control system
  • sudo - Privilege escalation
  • curl - Data transfer utility
  • nano - Text editor
⁠Configuration
  • SSH Port: 22 (mapped to host port 2222)
  • Default User: root
  • Default Password: password
  • Git Configuration: Pre-configured for h4shell user

⁠Usage Examples

⁠Basic Podman Commands

After SSH access, you can use Podman commands:

# Check Podman version
podman --version

# List containers
podman ps

# Pull an image
podman pull alpine

# Run a container
podman run -it alpine /bin/sh
⁠Managing the Container
# Start the container
docker start podman-environment

# Stop the container
docker stop podman-environment

# Remove the container
docker rm podman-environment

# View logs
docker logs podman-environment

⁠Security Considerations

⚠️ Important Security Notes:

  • The container runs in privileged mode which grants extensive system access
  • Default credentials are weak and should be changed for production use
  • SSH is enabled with password authentication
  • Intended for development/testing environments only
⁠Changing Default Password

After first login, change the default password:

passwd root

⁠Troubleshooting

⁠Container Won't Start
  • Ensure Docker daemon is running
  • Check if port 2222 is already in use
  • Verify privileged mode is supported on your system
⁠SSH Connection Issues
  • Confirm container is running: docker ps
  • Check port mapping: docker port podman-environment
  • Verify SSH service is running inside container
⁠Podman Issues
  • Ensure cgroups are properly configured
  • Check if the host system supports nested containerization
  • Verify privileged mode is enabled

⁠File Structure

/
├── usr/bin/entrypoint.sh          # Container startup script
├── etc/ssh/sshd_config            # SSH daemon configuration
└── root/.ssh/                     # SSH keys directory

⁠Environment Variables

The container supports the following build-time variables:

  • ENV_USER: Default user (default: root)
  • ENV_PASS: Default password (default: password)
  • GIT_NAME: Git username (default: h4shell)
  • GIT_EMAIL: Git email (default: [email protected]⁠)

⁠Volume Mounts

  • home:/root - Persistent storage for the root user's home directory

⁠Network Configuration

  • Host Port: 2222
  • Container Port: 22
  • Protocol: TCP (SSH)

⁠Contributing

This container is maintained by h4shell.

Tag summary

Content type

Image

Digest

sha256:c79330459…

Size

87.8 MB

Last updated

over 1 year ago

docker pull h4shelldocker/podman-environment