mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-25 11:56:50 +00:00
fix: apply review feedback on Docker storage and security documentation
- Fix storage_ip derivation to use default route first, not Swarm RemoteManagers - Make iSCSI container entrypoint idempotent (check before create for target/LUN/bind) - Pin erichough/nfs-server from 'latest' to '2.2.1' for reproducibility - Replace curl|sh Docker install with apt repo in Dockerfile.test - Add docker.sock security warnings in docker-compose.test.yml and CI workflow - Update stale 'storage VM' references in comments and .env.test.example" Co-authored-by: GoodOlClint <151449+GoodOlClint@users.noreply.github.com> Agent-Logs-Url: https://github.com/GoodOlClint/PSProxmoxVE/sessions/534c0a63-2988-496c-b0ae-e291fcfa050b
This commit is contained in:
@@ -30,15 +30,24 @@ services:
|
||||
fi
|
||||
tgtd --foreground &
|
||||
sleep 2
|
||||
tgtadm --lld iscsi --op new --mode target --tid 1 -T $$ISCSI_IQN
|
||||
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /srv/iscsi/lun0.img
|
||||
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
|
||||
# Create target if it does not already exist
|
||||
if ! tgtadm --lld iscsi --op show --mode target | grep -q "Target 1: $$ISCSI_IQN"; then
|
||||
tgtadm --lld iscsi --op new --mode target --tid 1 -T $$ISCSI_IQN
|
||||
fi
|
||||
# Create logical unit (LUN 1) if it does not already exist
|
||||
if ! tgtadm --lld iscsi --op show --mode logicalunit --tid 1 2>/dev/null | grep -qE "LUN:[[:space:]]*1($|[^0-9])"; then
|
||||
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /srv/iscsi/lun0.img
|
||||
fi
|
||||
# Bind target to all initiators if not already bound
|
||||
if ! tgtadm --lld iscsi --op show --mode target --tid 1 2>/dev/null | grep -q "Initiator-address: ALL"; then
|
||||
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
|
||||
fi
|
||||
echo "iSCSI target ready: $$ISCSI_IQN (port 3260)"
|
||||
wait
|
||||
restart: unless-stopped
|
||||
|
||||
nfs-server:
|
||||
image: erichough/nfs-server:latest
|
||||
image: erichough/nfs-server:2.2.1
|
||||
container_name: pvetest-nfs
|
||||
network_mode: host
|
||||
privileged: true
|
||||
|
||||
Reference in New Issue
Block a user