Giter VIP home page Giter VIP logo

alpine-postgres's Introduction

Postgres container image running on Alpine Linux

Docker Automated build Docker Pulls Docker Stars

Alpine Version Postgres Version

This container image (yobasystems/alpine-postgres) is based on the minimal Alpine Linux with Postgres 16.3 object-relational database server.

Alpine Version 3.20.2 (Released 2024-07-22)

Postgres Version 16.3

Table of Contents

๐Ÿ”๏ธ What is Alpine Linux?

Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here and you can see how their mantra fits in right at home with Container images.

What is Postgres?

PostgreSQL, often simply "Postgres", is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance. As a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). It can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users. Recent versions also provide replication of the database itself for security and scalability.

โœจ Features

  • Minimal size only, minimal layers
  • Memory usage is minimal on a simple install.

๐Ÿ—๏ธ Architectures

  • :amd64, :x86_64 - 64 bit Intel/AMD (x86_64/amd64)
  • :arm64v8, :aarch64 - 64 bit ARM (ARMv8/aarch64)
  • :arm32v7, :armhf - 32 bit ARM (ARMv7/armhf)

๐Ÿ“ PLEASE CHECK TAGS BELOW FOR SUPPORTED ARCHITECTURES, THE ABOVE IS A LIST OF EXPLANATION

๐Ÿท๏ธ Tags

  • :latest latest branch based (Automatic Architecture Selection)
  • :master master branch usually inline with latest
  • :amd64, :x86_64 amd64 based on latest tag but amd64 architecture
  • :aarch64, :arm64v8 Armv8 based on latest tag but arm64 architecture
  • :armhf, :arm32v7 Armv7 based on latest tag but arm32 architecture

๐Ÿ“ Layers & Sizes

Version MicroBadger Layers (tag) MicroBadger Size (tag)

Version MicroBadger Layers (tag) MicroBadger Size (tag)

Version MicroBadger Layers (tag) MicroBadger Size (tag)

Volume structure

  • /var/lib/postgresql/data: Database files

๐Ÿš€ How to use this image

Environment Variables:

The PostgreSQL image uses several environment variables which are easy to miss. While none of the variables are required, setting a password as a minimum will ensure some degree of security when using the image.

Main Postgres parameters:

  • POSTGRES_PASSWORD: This environment variable is recommended for you to use the PostgreSQL image. This environment variable sets the superuser password for PostgreSQL. The default superuser is defined by the POSTGRES_USER environment variable. In the above example, it is being set to "RaNd0MpA55W0Rd".

  • POSTGRES_USER: This optional environment variable is used in conjunction with POSTGRES_PASSWORD to set a user and its password. This variable will create the specified user with superuser power and a database with the same name. If it is not specified, then the default user of "postgres" will be used.

  • PGDATA: This optional environment variable can be used to define another location - like a subdirectory - for the database files. The default is /var/lib/postgresql/data, but if the data volume you're using is a fs mountpoint (like with GCE persistent disks), Postgres initdb recommends a subdirectory (for example /var/lib/postgresql/data/pgdata ) be created to contain the data.

  • POSTGRES_DB: This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.

  • POSTGRES_INITDB_ARGS: This optional environment variable can be used to send arguments to postgres initdb. The value is a space separated string of arguments as postgres initdb would expect them. This is useful for adding functionality like data page checksums: -e POSTGRES_INITDB_ARGS="--data-checksums".

https://www.postgresql.org/

Creating an instance

docker run --name some-postgres -e POSTGRES_PASSWORD=RaNd0MpA55W0Rd -d yobasystems/alpine-postgres

It will create a new db called "postgres", with user "postgres" and set root password of "RaNd0MpA55W0Rd".

Docker Compose example:

####(Please pass your own credentials, don't use these ones for production!!)

mysql:
  image: yobasystems/alpine-postgres:16.3
  environment:
    POSTGRES_DB: salesdb
    POSTGRES_USER: johnsmith
    POSTGRES_PASSWORD=RaNd0MpA55W0Rd
  expose:
    - "5432"
  volumes:
    - /data/postgres/pgdata:/var/lib/postgresql/data
  restart: always

๐Ÿ” Image contents & Vulnerability analysis

PACKAGE NAME PACKAGE VERSION VULNERABILITIES

๐Ÿ“š Source Repositories

๐Ÿณ Container Registries

๐Ÿ”— Links

๐Ÿ’ฐ Donation

BMAC

BITCOIN

ETHEREUM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.