summaryrefslogtreecommitdiffstats
path: root/tools/docker-compose/entrypoint.sh
blob: 03a3b46616c2f9c89c9e0384d11adbbdf8ef506b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

if [ `id -u` -ge 500 ] || [ -z "${CURRENT_UID}" ]; then

cat << EOF > /etc/passwd
root:x:0:0:root:/root:/bin/bash
awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash
nginx:x:`id -u nginx`:`id -g nginx`:Nginx web server:/var/lib/nginx:/sbin/nologin
EOF

cat <<EOF >> /etc/group
awx:x:`id -u`:awx
EOF

cat <<EOF > /etc/subuid
awx:100000:50001
EOF

cat <<EOF > /etc/subgid
awx:100000:50001
EOF

fi

# Required to get rootless podman working after
# writing out the sub*id files above
podman system migrate

if [[ "$OS" ==  *"Docker Desktop"* ]]; then
    export SDB_NOTIFY_HOST='docker.for.mac.host.internal'
else
    export SDB_NOTIFY_HOST=$(ip route | head -n1 | awk '{print $3}')
fi

exec $@