Sign inSign up

zurutech/go-dbmate-postgres

By zurutech

•Updated about 1 year ago

Image
0

371

zurutech/go-dbmate-postgres repository overview

FROM ubuntu:22.04

# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive

# Install essential tools and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    wget \
    curl \
    ca-certificates \
    gnupg2 \
    software-properties-common && \
    rm -rf /var/lib/apt/lists/*

# Add PostgreSQL repository and install PostgreSQL Client 16
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /usr/share/keyrings/pgdg-keyring.gpg && \
    echo "deb [signed-by=/usr/share/keyrings/pgdg-keyring.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends postgresql-client-16 && \
    rm -rf /var/lib/apt/lists/*

# Install Go 1.19
RUN wget https://go.dev/dl/go1.19.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz && \
    rm go1.19.linux-amd64.tar.gz && \
    ln -s /usr/local/go/bin/go /usr/local/bin/go

# Install Dbmate 2.13.0
RUN curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/download/v2.13.0/dbmate-linux-amd64 && \
    chmod +x /usr/local/bin/dbmate

# Verify installations
RUN go version && dbmate --version && psql --version

# Set PATH for Go
ENV PATH="/usr/local/go/bin:${PATH}"

Tag summary

Content type

Image

Digest

sha256:685161faa…

Size

166.3 MB

Last updated

about 1 year ago

docker pull zurutech/go-dbmate-postgres:1.24-2.13-16