Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Created January 25, 2024 22:26
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 Postrediori/8794cab25869dbf7ca76d8b74d68f4de to your computer and use it in GitHub Desktop.
Save Postrediori/8794cab25869dbf7ca76d8b74d68f4de to your computer and use it in GitHub Desktop.
Docket containers tips&tricks

Docker HowTos

Export image to tar archive:

docker export -o myapp.tar myapp:latest

Import image from tar archive:

docker image import myapp.tar myapp:latest

Run image interactively (new container would be removed after exit)

docker run --rm -it --entrypoint /bin/bash myapp:latest

Run Ubuntu 20.04 standard container interactively (auto-removeable container):

docker run --rm -it --entrypoint /bin/bash ubuntu:20.04

Create container from Ubuntu 20.04 satndard image and login into it:

docker run --name mycontainer -d -i -t ubuntu:20.04 /bin/sh
docker exec -it mycontainer /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment