Skip to content

Instantly share code, notes, and snippets.

@henkin
Last active October 16, 2020 20:10
Show Gist options
  • Save henkin/a82bf909106a1425bec154e4dadd0709 to your computer and use it in GitHub Desktop.
Save henkin/a82bf909106a1425bec154e4dadd0709 to your computer and use it in GitHub Desktop.
docker single script in ubuntu
#!/usr/bin/env bash
set -x
chmod +x "$1"
docker build -t $1 -f- . <<EOF
FROM osexp2000/ubuntu-with-utils
COPY $1 ./
USER root
ENTRYPOINT [ "bash", "$1" ]
EOF
docker run "--name=$1" "$1"
docker rm $1 && docker rmi "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment