Skip to content

Commit

Permalink
docker error workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed Feb 16, 2018
1 parent 6734e53 commit d19ee7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion docker/bin/msfconsole
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ if [[ $PARAMS == *"--rebuild"* ]]; then
exit $?
fi

docker-compose run --rm --service-ports ms ./msfconsole -r docker/msfconsole.rc "$PARAMS"
# 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

0 comments on commit d19ee7a

Please sign in to comment.