Skip to content

Commit 26b290b

Browse files
committed
feat(modules): user module
1 parent b8a170b commit 26b290b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Create a user and group used to launch processes
5+
# We use the ID 185 for the group as well as for the user.
6+
# This ID is registered static ID for the JBoss EAP product
7+
# on RHEL which makes it safe to use.
8+
groupadd -r $USER -g $UID && useradd -u $UID -r -g root -G $USER -m -d $HOME -s /sbin/nologin -c "$GECOS" $USER
9+
10+
# OPENJDK-533, OPENJDK-556: correct permissions for OpenShift etc
11+
chmod 0770 $HOME
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
schema_version: 1
2+
name: org.eclipse.jkube.user
3+
version: 1.0.0
4+
description: >
5+
Configures the default user and permissions. This module should be included by all images.
6+
7+
Adapted from:
8+
- https://github.com/jboss-container-images/openjdk/blob/d14ec7f363956b73684409c8b6bd9c766507013b/modules/user/
9+
- https://github.com/jboss-openshift/cct_module/blob/f91fb2f80dd880ed7498d4dfc3afb35dfcef60bd/jboss/container/user/
10+
11+
envs:
12+
- name: "USER"
13+
value: "jboss"
14+
- name: "UID"
15+
value: &uid 185
16+
- name: "HOME"
17+
value: "/home/jboss"
18+
- name: "GECOS"
19+
value: "JBoss user"
20+
21+
packages:
22+
install:
23+
- shadow-utils # groupadd
24+
25+
execute:
26+
- script: configure.sh
27+
28+
run:
29+
user: *uid
30+
workdir: "/home/jboss"

0 commit comments

Comments
 (0)