Commit 4f5e0f76 authored by Ulf Seltmann's avatar Ulf Seltmann
Browse files

initial commit

parents
FROM fedora:latest
ENTRYPOINT [ "/docker-entrypoint" ]
RUN yum install -y scsi-target-utils
ADD docker-entrypoint /docker-entrypoint
RUN chmod a+x /docker-entrypoint
\ No newline at end of file
# usage
docker run --rm --useltmann/iscsi-target
\ No newline at end of file
#!/bin/bash
if [ ! -f /var/tmp/iscsi-disk1 ];then
dd if=/dev/zero of=/var/tmp/iscsi-disk1 bs=1M count=1024
fi
#semanage fcontext -a -t tgtd_var_lib_t /var/tmp/iscsi-disk1
#restorecon -Rv /var/tmp/iscsi-disk1
# start in background but in foreground-mode so we get the messages
tgtd -f &
sleep 5
# Create a target device:
tgtadm --lld iscsi --mode target --op new --tid=1 --targetname iqn.2018-04.de.uni-leipzig.ub:for.all
# Add a logical unit (LUN)
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /var/tmp/iscsi-disk1
# Add IP wildcard to allow all initiators
tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
cat
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment