From 612d374fbea8d616ebf276c30a6fbca78e8f4bf9 Mon Sep 17 00:00:00 2001
From: Chris Packham <judge.packham@gmail.com>
Date: Tue, 11 Feb 2020 20:25:37 +1300
Subject: [PATCH] testing/docker: set default value for CTNG_UID/CTNG_GID

Make the creation of docker images easier so that CTNG_UID/CTNG_GID have
a default value if it's not explicitly specified when building. This
will allow publishing of images on various package repositories (e.g.
docker hub, gitlab containers). dmgr.sh can still be used to set the
UID/GID to that of the current user when building a custom container.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
 testing/docker/alpine3.8/Dockerfile    | 4 ++--
 testing/docker/archlinux/Dockerfile    | 4 ++--
 testing/docker/centos6/Dockerfile      | 4 ++--
 testing/docker/centos7/Dockerfile      | 4 ++--
 testing/docker/fedora29/Dockerfile     | 4 ++--
 testing/docker/gentoo-amd64/Dockerfile | 4 ++--
 testing/docker/mint19-amd64/Dockerfile | 4 ++--
 testing/docker/ubuntu16.04/Dockerfile  | 4 ++--
 testing/docker/ubuntu18.04/Dockerfile  | 4 ++--
 testing/docker/ubuntu19.10/Dockerfile  | 4 ++--
 10 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/testing/docker/alpine3.8/Dockerfile b/testing/docker/alpine3.8/Dockerfile
index bfef1bd4..43da7acd 100644
--- a/testing/docker/alpine3.8/Dockerfile
+++ b/testing/docker/alpine3.8/Dockerfile
@@ -1,6 +1,6 @@
 FROM alpine:3.8
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN addgroup -g $CTNG_GID ctng
 RUN adduser -D -h /home/ctng -G ctng -u $CTNG_UID -s /bin/bash ctng
 # Activate community and testing repositories
diff --git a/testing/docker/archlinux/Dockerfile b/testing/docker/archlinux/Dockerfile
index 2298abd8..1a6a1486 100644
--- a/testing/docker/archlinux/Dockerfile
+++ b/testing/docker/archlinux/Dockerfile
@@ -1,6 +1,6 @@
 FROM archlinux/base:latest
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN pacman -Sy --noconfirm archlinux-keyring
 RUN pacman -Syu --noconfirm
 RUN pacman -S --noconfirm base-devel git help2man python unzip wget audit
diff --git a/testing/docker/centos6/Dockerfile b/testing/docker/centos6/Dockerfile
index 6c224cd4..7f11fe1a 100644
--- a/testing/docker/centos6/Dockerfile
+++ b/testing/docker/centos6/Dockerfile
@@ -1,6 +1,6 @@
 FROM centos:6
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN yum install -y epel-release
diff --git a/testing/docker/centos7/Dockerfile b/testing/docker/centos7/Dockerfile
index 0631c19e..e7b812a2 100644
--- a/testing/docker/centos7/Dockerfile
+++ b/testing/docker/centos7/Dockerfile
@@ -1,6 +1,6 @@
 FROM centos:7
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN yum install -y epel-release
diff --git a/testing/docker/fedora29/Dockerfile b/testing/docker/fedora29/Dockerfile
index 65a0c60e..15dfb348 100644
--- a/testing/docker/fedora29/Dockerfile
+++ b/testing/docker/fedora29/Dockerfile
@@ -1,6 +1,6 @@
 FROM fedora:29
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \
diff --git a/testing/docker/gentoo-amd64/Dockerfile b/testing/docker/gentoo-amd64/Dockerfile
index ec5c1312..b261cc38 100644
--- a/testing/docker/gentoo-amd64/Dockerfile
+++ b/testing/docker/gentoo-amd64/Dockerfile
@@ -1,6 +1,6 @@
 FROM gentoo/stage3-amd64-hardened
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
diff --git a/testing/docker/mint19-amd64/Dockerfile b/testing/docker/mint19-amd64/Dockerfile
index 2b4f1aef..cfc05e37 100644
--- a/testing/docker/mint19-amd64/Dockerfile
+++ b/testing/docker/mint19-amd64/Dockerfile
@@ -1,6 +1,6 @@
 FROM linuxmintd/mint19-amd64
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN apt-get update
diff --git a/testing/docker/ubuntu16.04/Dockerfile b/testing/docker/ubuntu16.04/Dockerfile
index e2ea06dc..a0b68ae1 100644
--- a/testing/docker/ubuntu16.04/Dockerfile
+++ b/testing/docker/ubuntu16.04/Dockerfile
@@ -1,6 +1,6 @@
 FROM ubuntu:16.04
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN apt-get update
diff --git a/testing/docker/ubuntu18.04/Dockerfile b/testing/docker/ubuntu18.04/Dockerfile
index 5dab8422..918dd930 100644
--- a/testing/docker/ubuntu18.04/Dockerfile
+++ b/testing/docker/ubuntu18.04/Dockerfile
@@ -1,6 +1,6 @@
 FROM ubuntu:18.04
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN apt-get update
diff --git a/testing/docker/ubuntu19.10/Dockerfile b/testing/docker/ubuntu19.10/Dockerfile
index 453d97c7..0c39ffcd 100644
--- a/testing/docker/ubuntu19.10/Dockerfile
+++ b/testing/docker/ubuntu19.10/Dockerfile
@@ -1,6 +1,6 @@
 FROM ubuntu:19.10
-ARG CTNG_UID
-ARG CTNG_GID
+ARG CTNG_UID=1000
+ARG CTNG_GID=1000
 RUN groupadd -g $CTNG_GID ctng
 RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
 RUN apt-get update