mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 04:18:11 -06:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
8b71265807
|
|||
d9df63f836
|
|||
c9799b9a77
|
@ -76,7 +76,11 @@ fi
|
|||||||
# Find .sh files in /usr/bin/custom-scripts and execute them in order
|
# Find .sh files in /usr/bin/custom-scripts and execute them in order
|
||||||
for script in $(find /usr/bin/custom-scripts -name "*.sh" | sort); do
|
for script in $(find /usr/bin/custom-scripts -name "*.sh" | sort); do
|
||||||
chmod +x $script
|
chmod +x $script
|
||||||
sudo -u $HOME_USER bash -c "source /etc/environment; $script"
|
if [[ $script == *"sudo"* ]]; then
|
||||||
|
sudo -u $HOME_USER bash -c "source /etc/environment; sudo $script"
|
||||||
|
else
|
||||||
|
sudo -u $HOME_USER bash -c "source /etc/environment; $script"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Move the .bashrc file to the user's home directory
|
# Move the .bashrc file to the user's home directory
|
||||||
|
@ -132,6 +132,14 @@ nvm use default && npm install -g @vscode/vsce
|
|||||||
```
|
```
|
||||||
The #!/bin/bash line at the top of the script tells the system that this script should be run with the Bash shell.
|
The #!/bin/bash line at the top of the script tells the system that this script should be run with the Bash shell.
|
||||||
|
|
||||||
|
#### Note on sudo privileges
|
||||||
|
|
||||||
|
If the script name includes the word "sudo", the script will be run with root privileges. This is useful if your script needs to perform operations that require superuser privileges.
|
||||||
|
|
||||||
|
For instance, if you have a script named `install_sudo_package.sh`, this script will be run with root privileges due to the inclusion of "sudo" in the file name.
|
||||||
|
|
||||||
|
Please be aware of the security implications when running scripts with root privileges. Ensure that your script does not perform any unsafe or destructive operations when run with these privileges.
|
||||||
|
|
||||||
### 3. Run your Docker container
|
### 3. Run your Docker container
|
||||||
When you start your Docker container, all .sh files in the /usr/bin/custom-scripts directory will be automatically executed in alphabetical order. The environment variables from the /etc/environment file will be loaded before each script is executed.
|
When you start your Docker container, all .sh files in the /usr/bin/custom-scripts directory will be automatically executed in alphabetical order. The environment variables from the /etc/environment file will be loaded before each script is executed.
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
3.0.25
|
3.0.28
|
Reference in New Issue
Block a user