Skip to content

Instantly share code, notes, and snippets.

@grahamhelton
Last active May 30, 2024 23:55
Show Gist options
  • Save grahamhelton/5f1c7ef0722a2766bffaacb41d168fcd to your computer and use it in GitHub Desktop.
Save grahamhelton/5f1c7ef0722a2766bffaacb41d168fcd to your computer and use it in GitHub Desktop.
Build tool into docker image
# Install certipy
apt update -y &> /dev/null && apt upgrade -y &> /dev/null && apt install -y python3 python3-pip &> /dev/null && pip3 install certipy-ad &> /dev/null ; echo -e "\033[0;32m - Certipy installed \033[0m"
# List containers, identify container id
sudo docker container ls
# Stage the current container into an image
sudo docker commit <container_id> <image_name>
# Save the image as a .tar file
sudo docker save <image_name> > <image_name>.tar
# <Transfer .tar to target>
# Load the image from .tar
sudo docker image load < <image_name>.tar
# Run the container
sudo docker run -it <image_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment