docker error workaround
parent
6734e532f5
commit
d19ee7a403
|
@ -47,7 +47,7 @@ RUN apk update && \
|
|||
&& apk del .ruby-builddeps \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN adduser -g msfconsole -D $MSF_USER
|
||||
RUN adduser -g msfconsole -D $MSF_USER -u 1000
|
||||
|
||||
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
|
||||
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
|
||||
|
|
|
@ -27,4 +27,10 @@ if [[ $PARAMS == *"--rebuild"* ]]; then
|
|||
exit $?
|
||||
fi
|
||||
|
||||
# workaround if current user id is not the same as in the container.
|
||||
# Otherwise the ~/.msf4 folder is not writeable
|
||||
if [[ $EUID -ne 1000 ]]; then
|
||||
docker-compose run --rm -u root --service-ports ms ./msfconsole -r docker/msfconsole.rc "$PARAMS"
|
||||
else
|
||||
docker-compose run --rm --service-ports ms ./msfconsole -r docker/msfconsole.rc "$PARAMS"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue