Created
June 6, 2022 08:23
-
-
Save thomasaarholt/2225fb6fd4de8dffdb6cad300277c64c to your computer and use it in GitHub Desktop.
Instructions for building a docker image and logging into its bash terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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