Spaces:
Paused
Paused
BinaryONe
commited on
Commit
·
db27f7e
1
Parent(s):
dc8b795
Changes
Browse files- Dockerfile +3 -1
- start.sh +1 -0
Dockerfile
CHANGED
|
@@ -73,8 +73,10 @@ WORKDIR /app
|
|
| 73 |
EXPOSE 7860 2222
|
| 74 |
|
| 75 |
# Switch to 'admin' user and set working directory
|
| 76 |
-
|
| 77 |
#WORKDIR /home/admin
|
|
|
|
|
|
|
| 78 |
|
| 79 |
# Default command to keep the container running
|
| 80 |
CMD ["/app/start.sh"]
|
|
|
|
| 73 |
EXPOSE 7860 2222
|
| 74 |
|
| 75 |
# Switch to 'admin' user and set working directory
|
| 76 |
+
USER admin
|
| 77 |
#WORKDIR /home/admin
|
| 78 |
+
# Change ownership of /home/admin directory
|
| 79 |
+
RUN chown -R admin:admin /home/admin
|
| 80 |
|
| 81 |
# Default command to keep the container running
|
| 82 |
CMD ["/app/start.sh"]
|
start.sh
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
|
| 3 |
# Print the current hostname and user details
|
| 4 |
echo "* The hostname of this container is: $(cat /etc/hostname)"
|
|
|
|
| 5 |
echo "* The host of this container is: $(cat /etc/hosts)"
|
| 6 |
echo "* ID of the user running the script: $(id -u) * Group: $(id -g) * Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 7 |
|
|
|
|
| 2 |
|
| 3 |
# Print the current hostname and user details
|
| 4 |
echo "* The hostname of this container is: $(cat /etc/hostname)"
|
| 5 |
+
echo "* The Current User of this container is: $(whoami)"
|
| 6 |
echo "* The host of this container is: $(cat /etc/hosts)"
|
| 7 |
echo "* ID of the user running the script: $(id -u) * Group: $(id -g) * Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 8 |
|