I'm trying to use the Docker metasploit image within my own Dockerfile
config which is this one:
FROM metasploitframework/metasploit-framework
WORKDIR /usr/src/my-awesome-tool
COPY . .
RUN pip3 install --upgrade pip
RUN pip3 install --editable .
RUN echo 'alias msfconsole="/usr/src/metasploit-framework/msfconsole"' >> ~/.bashrc
RUN echo 'alias msfvenom=/usr/src/metasploit-framework/msfvenom"' >> ~/.bashrc
# The metasploit-framework docker image needs to stay here.
WORKDIR /usr/src/metasploit-framework
ENTRYPOINT ["my-awesome-tool"]
The image is created perfectly with sudo docker build -t my-awesome-tool .
and I run it as sudo docker run -it --rm --privileged --network=host my-awesome-tool
but, if I check if the alias msfconsole
was created, it was not.