Google Cloud Shell [Link] – Free cloud service that allows running shell commands on a Debian-based customized distribution.

This service is a shared instance of a VM with 16GB of RAM, 4vCPU, and 5GB of Storage.

It has a usage limit of 50 hours per week, and 20 minutes after logging out the instance resets itself.

Note: there is no income port open to the internet, only HTTP traffic can come in through a reverse proxy (multi-handler will not work).

sudo docker pull metasploitframework/metasploit-framework
sudo docker run --name msf --rm -it -p 443:443 -v ${PWD}:/root/.msf4 metasploitframework/metasploit-framework

An alternative would be Kali + Top 10 Tools.

sudo docker pull kalilinux/kali-rolling
sudo docker run --name kali -ti kalilinux/kali-rolling /bin/bash

Then set up the environment:

apt update && apt dist-upgrade -y && apt autoremove && apt clean
apt install kali-tools-top10

Keep in mind the time of both images:

REPOSITORY                                  SIZE
metasploitframework/metasploit-framework    1.21GB
kalilinux/kali-rolling                      125MB

And then the size after Kali gets all the tools installed:

NAME   IMAGE                    SIZE
kali   kalilinux/kali-rolling   2.92GB (virtual 3.04GB)

Another alternative is to install The PenTesters Framework (PTF):

sudo docker run --name ptf -ti kalilinux/kali-rolling /bin/bash

Then,

apt update && apt dist-upgrade -y && apt autoremove && apt clean
apt install git pip -y
git clone https://github.com/trustedsec/ptf.git
cd ptf
pip install -r requirements.txt
./ptf

Inside the PTF install Metasploit:

use modules/exploitation/metasploit
install

And then the size after install PTF + MSF on Kali the final size is:

NAME   IMAGE                    SIZE
ptf    kalilinux/kali-rolling   1.97GB (virtual 2.09GB)