Skip to content

Instantly share code, notes, and snippets.

View wlad's full-sized avatar
✔️
Robot Framework ❤️ 🚀 🚀 🚀

RobotFramework(er) wlad

✔️
Robot Framework ❤️ 🚀 🚀 🚀
View GitHub Profile
@wlad
wlad / postgres-docker-buildx-issue.md
Last active September 13, 2021 16:29
PostgreSQL Docker / buildx issue - An image created with buildx (Moby BuildKit) requires to set custom PGDATA location

I noticed a different behavior of postgres docker containers depending on whether the image was build with docker build (normal Docker) or with docker buildx build (Moby BuildKit).

Case 1 - the failing case (docker buildx / Moby BuildKit)

# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM postgres:13.4-alpine
ARG TARGETPLATFORM
ARG BUILDPLATFORM
FROM postgres:13.3-alpine
# SHOW POSTGRES DB AND CLIENT VERSION
RUN postgres -V && \
psql -V
# # SET DEFAULT VALUES FOR DATABASE USER AND PASSWORDS
# ARG EHRBASE_USER="ehrbase"
# ARG EHRBASE_PASSWORD="ehrbase"
# ENV EHRBASE_USER=${EHRBASE_USER}
@wlad
wlad / Dockerfile (Multistage EHRbase Build).dockerfile
Last active July 7, 2021 13:12
EHRbase - Multi Stage Dockerfile Build
FROM postgres:13.3-alpine AS builder
# SHOW POSTGRES DB AND CLIENT VERSION
RUN postgres -V && \
psql -V
# CREATE CUSTOM DATA DIRECTORY AND CHANGE OWNERSHIP TO POSTGRES USER
# SET POSTGRES DATA DIRECTORY TO CUSTOM FOLDER AND INITIALIZE DB
RUN mkdir -p ${PGDATA}
RUN chown postgres: ${PGDATA}
@wlad
wlad / install-docker.sh
Last active January 18, 2021 15:18 — forked from madkoding/install-docker-deepin.sh
Install Docker-CE script for Deepin 20.1 Linux
#!/bin/sh
# Shell script to add docker-ce to Deepin Linux repositories
# Remove old docker
sudo apt-get remove -y docker docker-engine docker.io containerd runc
# Install dependencies
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common