Skip to content

Instantly share code, notes, and snippets.

@zeitounator
Created May 22, 2023 09:47
Show Gist options
  • Save zeitounator/6bfe703f495a360eec073215a53edac0 to your computer and use it in GitHub Desktop.
Save zeitounator/6bfe703f495a360eec073215a53edac0 to your computer and use it in GitHub Desktop.
$ ls -l testSO.sh
-rwxr--r-- 1 olcla users 75 mai 22 11:43 testSO.sh
$ cat testSO.sh
#! /usr/bin/env bash
docker exec testSO bash -c "stat -c '%U' /etc/passwd"
$ docker run -d --rm --name testSO ubuntu:latest tail -f /dev/null
f3b812df7bb35eafb2f2c2b144280329e9fa90539845861c619a460465badafb
$ docker exec testSO bash -c "stat -c '%U' /etc/passwd"
root
$ ./testSO.sh
root
$ docker stop testSO
testSO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment