Skip to content

Commit

Permalink
Add user to docker group earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro-afanasiev authored and Mykhailo committed Oct 29, 2024
1 parent 0a219d1 commit b7eced5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions deployment/aws-ami/debian-minikube/ami-initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,13 @@ if [ -z "$RULE_ENGINE_RELEASE" ]; then
error_log "RULE_ENGINE_RELEASE env is required"
exit 1
fi
# some steps that are better to be done before user tries to log in, so put them first
sudo -u "$FIRST_USER" mkdir -p "$(getent passwd "$FIRST_USER" | cut -d: -f6)/.local/bin" || true

log "Adding user $FIRST_USER to docker group"
sudo groupadd docker || true
sudo usermod -aG docker "$FIRST_USER" || true

log "Script is executed on behalf of $(id)"
log "The first run. Configuring sre for user $FIRST_USER"

Expand Down Expand Up @@ -292,9 +298,6 @@ install_kubectl "$KUBECTL_VERSION"
log "Installing helm $HELM_VERSION"
install_helm "$HELM_VERSION"

log "Adding user $FIRST_USER to docker group"
sudo usermod -aG docker "$FIRST_USER"

log "Starting minikube and installing helm releases on behalf of $FIRST_USER"
sudo su - "$FIRST_USER" <<EOF
minikube start --driver=docker --container-runtime=containerd -n 1 --force --interactive=false --memory=max --cpus=max --profile rule-engine --kubernetes-version=$KUBERNETES_VERSION
Expand Down
4 changes: 4 additions & 0 deletions deployment/aws-ami/debian-minikube/sre-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ log "Initializing Syndicate Rule Engine for the first time"
log "-----------------------------------------------------"
log "Creating ~/.local/bin for $FIRST_USER" # wish to do it faster than user manages to log in to trigger ~/.profile
sudo -u "$FIRST_USER" mkdir -p "$(getent passwd "$FIRST_USER" | cut -d: -f6)/.local/bin" || true
log "Adding user $FIRST_USER to docker group"
sudo groupadd docker || true
sudo usermod -aG docker "$FIRST_USER" || true

log "Installing jq and curl"
sudo apt update -y && sudo apt install -y jq curl

Expand Down

0 comments on commit b7eced5

Please sign in to comment.