Skip to content

Instantly share code, notes, and snippets.

@dmitriykovalev
Created June 23, 2023 19:57
Show Gist options
  • Select an option

  • Save dmitriykovalev/eb1aa22c39139e1ed4855aeb1fbe666c to your computer and use it in GitHub Desktop.

Select an option

Save dmitriykovalev/eb1aa22c39139e1ed4855aeb1fbe666c to your computer and use it in GitHub Desktop.
set -e
if [[ -f /.dockerenv ]]; then
exit 1
fi
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly DOCKER_IMAGE_TAG=$(docker build --quiet - <<EOF
FROM debian:bullseye
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
python2.7
EOF
)
docker run -it --rm -v $(pwd):/workspace -w /workspace "${DOCKER_IMAGE_TAG}" /usr/bin/python2.7 "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment