Skip to content

Instantly share code, notes, and snippets.

@ScreamingDev
Created May 1, 2016 09:52
Show Gist options
  • Save ScreamingDev/fdcf9b4dd6ca726bb4725f866dd1ce3e to your computer and use it in GitHub Desktop.
Save ScreamingDev/fdcf9b4dd6ca726bb4725f866dd1ce3e to your computer and use it in GitHub Desktop.
Docker chown inside container
#!/usr/bin/env bash
adduser --system --uid=$(stat -c "%u" /var/www) "host"
echo "APACHE_RUN_USER=host" >> /etc/apache2/envvars
SERVER_NAME=${SERVER_NAME:=localhost}
echo "ServerName $SERVER_NAME" > /etc/apache2/conf.d/server-name
/etc/init.d/apache2 start
bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment