fix: fixed some typos and refined it a bit
This commit is contained in:
parent
a95afc8680
commit
e7ddf9e9e6
8 changed files with 20 additions and 26 deletions
|
@ -6,6 +6,12 @@ You might want to change the hostname in docker-compose.yml to something you lik
|
||||||
You can change the './socat/data/socat.sh' and ips/ports you want to passtthrough. AND DONT FORGET TO DO THAT
|
You can change the './socat/data/socat.sh' and ips/ports you want to passtthrough. AND DONT FORGET TO DO THAT
|
||||||
TOO IN THE DOCKER-COMPOSE.YML!!
|
TOO IN THE DOCKER-COMPOSE.YML!!
|
||||||
|
|
||||||
|
## Network setup
|
||||||
|
You can set up the network with this:
|
||||||
|
```bash
|
||||||
|
sudo docker network create --ipam-driver default --subnet 192.168.12.0/24 netvm
|
||||||
|
```
|
||||||
|
|
||||||
## Building the images
|
## Building the images
|
||||||
We first need to build the images to do this:
|
We first need to build the images to do this:
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -4,10 +4,10 @@ networks:
|
||||||
name: netvm
|
name: netvm
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pve-server2:
|
pve-server:
|
||||||
image: pve-custom2
|
image: pve-custom
|
||||||
build: ./pve
|
build: ./pve
|
||||||
container_name: pve-server2
|
container_name: pve-server
|
||||||
privileged: true
|
privileged: true
|
||||||
hostname: pve-owo
|
hostname: pve-owo
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -14,7 +14,7 @@ RUN apt-get update && \
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** install runtime packages ****" && \
|
echo "**** install runtime packages ****" && \
|
||||||
apt update && apt install -y isc-dhcp-server kitty-terminfo btop logrotate neovim netcat-openbsd sudo openssh-server wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \
|
apt-get update && apt-get install -y isc-dhcp-server kitty-terminfo btop logrotate neovim netcat-openbsd openssh-server wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \
|
||||||
echo "**** setup openssh environment ****" && \
|
echo "**** setup openssh environment ****" && \
|
||||||
useradd -m rander && \
|
useradd -m rander && \
|
||||||
usermod --shell /bin/bash rander && \
|
usermod --shell /bin/bash rander && \
|
||||||
|
@ -82,7 +82,7 @@ RUN echo "root:root"|chpasswd
|
||||||
|
|
||||||
RUN systemctl enable pvenetcommit.service pve-firewall isc-dhcp-server
|
RUN systemctl enable pvenetcommit.service pve-firewall isc-dhcp-server
|
||||||
|
|
||||||
RUN mkdir -p /var/lib/dhcp && apt update && apt install ifupdown2 -y || true
|
RUN mkdir -p /var/lib/dhcp && apt-get update && apt-get install ifupdown2 -y || true
|
||||||
|
|
||||||
# add local files
|
# add local files
|
||||||
EXPOSE 2222
|
EXPOSE 2222
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
ADMIN_PASSWORD="nyaowo"
|
ADMIN_PASSWORD="nyaowo"
|
||||||
|
USER_PASSWORD="nyaowo"
|
||||||
|
|
||||||
# logging functions
|
# logging functions
|
||||||
pve_log() {
|
pve_log() {
|
||||||
|
@ -21,8 +22,8 @@ pve_error() {
|
||||||
|
|
||||||
# Verify that the minimally required password settings are set for new databases.
|
# Verify that the minimally required password settings are set for new databases.
|
||||||
docker_verify_minimum_env() {
|
docker_verify_minimum_env() {
|
||||||
if [ -z "$ADMIN_PASSWORD" ]; then
|
if [ -z "$ADMIN_PASSWORD" ] && [ "$USER_PASSWORD" ]; then
|
||||||
pve_error $'Password option is not specified\n\tYou need to specify an ADMIN_PASSWORD'
|
pve_error $'Password option is not specified\n\tYou need to specify an ADMIN/USER_PASSWORD'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,21 +34,21 @@ systemctl start networking && systemctl start isc-dhcp-server &
|
||||||
|
|
||||||
|
|
||||||
docker_setup_pve() {
|
docker_setup_pve() {
|
||||||
#Set pve user
|
#Set root user
|
||||||
echo "root:$ADMIN_PASSWORD"|chpasswd
|
echo "root:$ADMIN_PASSWORD"|chpasswd
|
||||||
|
#Set user
|
||||||
|
echo "pve:$USER_PASSWORD"|chpasswd
|
||||||
}
|
}
|
||||||
|
|
||||||
systemctl start networking && systemctl start isc-dhcp-server &
|
|
||||||
RELAY_HOST=${RELAY_HOST:-ext.home.local}
|
RELAY_HOST=${RELAY_HOST:-ext.home.local}
|
||||||
sed -i "s/RELAY_HOST/$RELAY_HOST/" /etc/postfix/main.cf
|
sed -i "s/RELAY_HOST/$RELAY_HOST/" /etc/postfix/main.cf
|
||||||
PVE_ENTERPRISE=${PVE_ENTERPRISE:-no}
|
PVE_ENTERPRISE=${PVE_ENTERPRISE:-no}
|
||||||
rm -f /etc/apt/sources.list.d/pve-enterprise.list
|
rm -f /etc/apt/sources.list.d/pve-enterprise.list
|
||||||
|
|
||||||
|
# functions
|
||||||
docker_verify_minimum_env
|
docker_verify_minimum_env
|
||||||
|
|
||||||
echo 'rander:12345' | chpasswd
|
|
||||||
|
|
||||||
docker_setup_pve
|
docker_setup_pve
|
||||||
|
sleep 10 && networking_misc &
|
||||||
|
|
||||||
if [ ! -d /var/log/pveproxy ]; then
|
if [ ! -d /var/log/pveproxy ]; then
|
||||||
mkdir -p /var/log/pveproxy
|
mkdir -p /var/log/pveproxy
|
||||||
|
@ -58,13 +59,10 @@ if [ -n "$ENABLE_PVE_FIREWALL" -a "$ENABLE_PVE_FIREWALL" == "no" ]; then
|
||||||
systemctl mask pve-firewall.service
|
systemctl mask pve-firewall.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10 && networking_misc &
|
|
||||||
echo "Running PVE..."
|
echo "Running PVE..."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
# Your commands or checks here
|
# Your commands or checks here
|
||||||
sleep 60 # Adjust the sleep interval as needed
|
sleep 1m # Adjust the sleep interval as needed
|
||||||
done
|
done
|
||||||
|
|
||||||
#exec gosu backup /usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-proxy "$@"
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ RUN apt-get update && \
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** install runtime packages ****" && \
|
echo "**** install runtime packages ****" && \
|
||||||
apt update && apt install -y socat logrotate btop kitty-terminfo neovim netcat-openbsd sudo wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \
|
apt update && apt install -y socat logrotate btop kitty-terminfo neovim netcat-openbsd sudo wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \
|
||||||
echo "**** setup openssh environment ****" && \
|
|
||||||
rm -rf \
|
rm -rf \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
$HOME/.cache
|
$HOME/.cache
|
||||||
|
@ -24,16 +23,10 @@ RUN \
|
||||||
#set (temporary) password for root
|
#set (temporary) password for root
|
||||||
RUN echo "root:root"|chpasswd
|
RUN echo "root:root"|chpasswd
|
||||||
|
|
||||||
# add local files
|
|
||||||
EXPOSE 2222
|
|
||||||
EXPOSE 8006
|
|
||||||
|
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
#use setup.sh to start proxmox service
|
|
||||||
STOPSIGNAL SIGINT
|
STOPSIGNAL SIGINT
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
VOLUME /config
|
|
||||||
#CMD [ "/lib/systemd/systemd", "log-level=info", "unit=sysinit.target"]
|
#CMD [ "/lib/systemd/systemd", "log-level=info", "unit=sysinit.target"]
|
||||||
|
|
|
@ -5,10 +5,8 @@ ADMIN_PASSWORD="nyaowo"
|
||||||
|
|
||||||
# Verify that the minimally required password settings are set for new databases.
|
# Verify that the minimally required password settings are set for new databases.
|
||||||
echo "root:$ADMIN_PASSWORD"|chpasswd
|
echo "root:$ADMIN_PASSWORD"|chpasswd
|
||||||
mkdir -p /var/lib/dhcp
|
|
||||||
/bin/bash /root/socat.sh &
|
/bin/bash /root/socat.sh &
|
||||||
|
|
||||||
|
|
||||||
echo "Running SOCAT..."
|
echo "Running SOCAT..."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue