Having trouble replacing docker commands with singularity, specifically when pulling a docker image

I am trying to run code that trains a neural network, but my computer doesn’t have enough CPUs so I have to use clusters. My ssh login doesn’t allow the use of docker, so it was suggested I replace the commands with singularity.

These are the commands I have been running in my terminal

cd adversarial-policies/
docker build --build-arg MUJOCO_KEY=~/.mujoco/mjkey.txt .
docker run -it --env MUJOCO_KEY=~/.mujoco/mjkey.txt humancompatibleai/adversarial_policies:latest /bin/bash 
source ./modelfreevenv/bin/activate
python -modelfree.multi.train with paper
python -m modelfree.visualize.scores with paper_config 
python -m modelfree.visualize.training with supplementary_config

I have replaced my commands so far with the following:

cp -rp ~/adversarial-policies/ $SLURM_TMPDIR
cd adversarial-policies/
singularity pull docker://humancompatibleai/adversarial_policies:latest
singularity run -it --env MUJOCO_KEY=~/.mujoco/mjkey.txt ./adversarial_policies-latest.simg
source ./modelfreevenv/bin/activate
python -m modelfree.multi.train with paper --path $SLURM_TMPDIR --data-path $SLURM_TMPDIR

You may notice that I change from building a docker image to pulling an image from the repo. I think this is required in this instance but could be wrong. I’m just not sure how to replace the docker command if I’m pulling a docker file.

Can someone please help me fix my issue.

Thank you!

Source: StackOverflow