-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for rootless docker via contexts
Added development environment for testing rootless docker
- Loading branch information
Showing
10 changed files
with
203 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker_context=default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker_context=Override the docker context,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Use the latest Ubuntu image as a parent | ||
FROM docker:27-dind-rootless | ||
|
||
USER root | ||
|
||
# Install Webmin on DIND container | ||
RUN set -eux; \ | ||
echo "root:root" | chpasswd && \ | ||
apk add perl perl-net-ssleay expect | ||
|
||
COPY webmin.exp / | ||
|
||
WORKDIR /opt | ||
|
||
RUN set -eux; \ | ||
wget -O - https://github.com/webmin/webmin/archive/refs/tags/2.202.tar.gz | tar -xzf - && \ | ||
mv webmin-2.202 webmin && \ | ||
/usr/bin/expect /webmin.exp && \ | ||
echo "$(cat /etc/webmin/webmin.acl) docker" > /etc/webmin/webmin.acl && \ | ||
mkdir /etc/webmin/docker | ||
|
||
# Last 2 line adds docker module to webmin's acl, for easier development and creates the config dir. | ||
# Also requires the volume & config in the compose file | ||
|
||
EXPOSE 10000 | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
WORKDIR /home | ||
|
||
|
||
#USER rootless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/expect | ||
|
||
set timeout -1 | ||
spawn "/opt/webmin/setup.sh" /usr/local/webmin | ||
expect "Config file directory " {send "\r"} | ||
expect "Log file directory " {send "/var/log/webmin\r"} | ||
expect "Full path to perl (default /usr/bin/perl):" {send "\r"} | ||
expect "Operating system:" {send "84\r"} | ||
expect "Version:" {send "ES4.0\r"} | ||
expect "Web server port (default 10000):" {send "\r"} | ||
expect "Login name (default admin):" {send "root\r"} | ||
expect "Login password:" {send "password\r"} | ||
expect "Password again:" {send "password\r"} | ||
expect "Use SSL (y/n):" {send "n\r"} | ||
expect "Start Webmin at boot time (y/n):" {send "y\r"} | ||
expect eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Start docker | ||
start-docker.sh | ||
|
||
# Your commands go here | ||
sed -i 's;ssl=1;ssl=0;' /etc/webmin/miniserv.conf | ||
# systemctl enable cron | ||
service webmin start | ||
tail -f /dev/null |