Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created June 6, 2022 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/2225fb6fd4de8dffdb6cad300277c64c to your computer and use it in GitHub Desktop.
Save thomasaarholt/2225fb6fd4de8dffdb6cad300277c64c to your computer and use it in GitHub Desktop.
Instructions for building a docker image and logging into its bash terminal
# From a directory with a Dockerfile
# Example Dockerfile with "Dockerfile" as filename
FROM python:3.10-slim-buster
RUN pip install numpy
# Then, run the following
docker build -t your_image_name .
# If you want to force targeting x86_64 architecture, add --platform linux/amd64
# If you want to force targeting arm architecture, add --platform linux/arm64
# To attach into a bash instance inside a built docker image:
docker run --rm -it --entrypoint bash your_image_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment