summaryrefslogtreecommitdiffstats
path: root/build/change-user.sh
blob: cb13141c67b3fc8bdc5bb8f506059bcd6a22346b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/env bash

set -o errexit

image="$1"
[ -n "$image" ] || image="docker.io/chsa/tomo-remote:evelina"

container=$(buildah from "$image")
buildah run $container sh -c "echo '$(id -ng):x:$(id -g):' >> /etc/group"
#buildah run $container sh -c "echo '$(id -nu):x:$(id -u):$(id -g):$(id -nu):/ccpi/data:/bin/bash' >> /etc/passwd"
buildah run $container sh -c "echo '$(id -nu):x:0:0:$(id -nu):/ccpi/data:/bin/bash' >> /etc/passwd"
buildah run $container sh -c "echo '$(id -nu):test' | chpasswd"
buildah commit --format docker $container tomo-remote:latest

echo "$container build from ${image} and saved as tomo-remote:latest"