Skip to content

Docker image builder for multiple dev tools: lazydocker, pspg, usql.

License

Notifications You must be signed in to change notification settings

dattached/devtools-docker-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker images for dev tools

  • bootstrap — Shell scripts to use in Dockerfiles.

  • lazydocker — A simple terminal UI for both docker and docker-compose.

  • usql — Universal command-line interface for SQL databases. Includes pspg, Unix pager designed for work with tables.

bootstrap

Docker Pulls

Managed collection of shell scripts to use in Dockerfiles:

See Documentation for details.

Simple example:

# Dockerfile
RUN --mount=type=bind,from=dattached/bootstrap,dst=/b \
    apt-get update; \
    bash /b/debian-apt-install-devtools.sh; \
    apt-get clean; \
    rm -rf /tmp/* /var/tmp/*

Example with cached APT directories (preferred):

# Dockerfile
RUN --mount=type=cache,dst=/var/cache/apt,sharing=locked \
    --mount=type=cache,dst=/var/lib/apt,sharing=locked \
    --mount=type=bind,from=dattached/bootstrap,dst=/b \
    apt-get update; \
    bash /b/debian-apt-install-devtools.sh; \
    rm -rf /tmp/* /var/tmp/*

lazydocker

Docker Pulls

Image for lazydocker terminal UI.

Example:

# compose.yml
services:
  # ...
  lazydocker:
    image: dattached/lazydocker
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      #- ./compose.yml:/compose.yml:ro
      #- ./config.yml:/root/.config/lazydocker/config.yml:ro

usql

Docker Pulls

Image for usql SQL console with pspg table pager.

Example:

# compose.yml
services:

  postgres:
    image: postgres:17-bookworm
    healthcheck:
      test: pg_isready -t3 -h127.0.0.1
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
      start_interval: 0s
    environment:
      PGDATA: /var/lib/postgresql/data/pgdata
      POSTGRES_DB_FILE: /postgres_db
      POSTGRES_USER_FILE: /postgres_user
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
    configs:
      - postgres_db
      - postgres_user
    secrets:
      - postgres_password
    volumes:
      - postgres_data:/var/lib/postgresql/data

  usql:
    image: dattached/usql:latest
    container_name: usql
    depends_on:
      postgres:
        condition: service_healthy
    stdin_open: true
    tty: true
    environment:
      POSTGRES_DB_FILE: /postgres_db
      POSTGRES_USER_FILE: /postgres_user
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
      USQL_CONF_TEMPLATE: /root/.config/usql/config.yaml.tpl
      USQL_CONNECTION: postgres
      USQL_FILEENV_NAMES: POSTGRES_*_FILE
    configs:
      - postgres_db
      - postgres_user
      - {source: usql_config, target: /root/.config/usql/config.yaml.tpl}
    secrets:
      - postgres_password

configs:
  postgres_db: {content: postgres-test}
  postgres_user: {content: postgres-test}
  usql_config: {file: config.yaml}

secrets:
  postgres_password: {environment: POSTGRES_PASSWORD}

volumes:
  postgres_data:
# config.yaml
connections:
  postgres: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
# .env
export POSTGRES_PASSWORD=secret

Development

Install Task.

For IMG one of bootstrap, lazydocker, usql:

$ task init
$ task build:IMG
$ task testrun:IMG
$ task release:IMG
$ task clean

About

Docker image builder for multiple dev tools: lazydocker, pspg, usql.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published