Last active
February 7, 2022 07:04
-
-
Save jjb/3df3828bb9da9636771bf9efac565544 to your computer and use it in GitHub Desktop.
How to build a Dockerfile and open a shell in it
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
# "foo" is not a placeholder, it's a name that needs to be given | |
# this exact command will work if a Dockerfile is present | |
docker build -t foo . && docker run -it foo | |
# if you want to force creation of an amd64 image when on an M1/arm64 Mac | |
docker build --platform linux/amd64 -t foo . && docker run -it foo | |
# if your container doesn't have a shell as an entrypoint | |
# e.g. node:@latest | |
docker build --platform linux/amd64 -t foo . && docker run -it --entrypoint bash foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment