Skip to main content

docker sh -it

BUILDING DOCKERIFLES OVER AND OVER AGAIN WITH NO FEEDBACK AT ALL IS LIKE WEARING
THREE CONDOMS I'M TOO OLD FOR THIS SHIT I NEED TO TOUCH IT AND FEEL WHAT'S GOING
ON IN THERE OR I'LL LOSE INTEREST WHY CAN'T WE JUST CONNECT AND GET FEEDBACK AND
A RHYTHM GOING INSTEAD OF ALL THIS STOPPING AND STARTING IT'S REALLY OFF-PUTTING
AND NOT GOOD FOR ANYONE WHY NOT CONNECT TO THE CONTAINER THEN TYPE YOUR COMMANDS
IN AND WHEN THEY WORK THEY GET ADDED TO THE dOCKERFILE AND IF THEY DON'T THEY GO
IN AS COMMENTS OR SOMETHING AND IN THE BACKGROUND IT'S REBUILDING YOUR IMAGE AND
RECONNECTING READY FOR THE NEXT COMMAND OH AND HAVE IT WORK WITH THINGS LIKE add
AND copy AND STUFF THEN WHEN YOU'VE ACTUALLY GOT SOMETHING THAT WORKS YOU CAN GO
AND EDIT IT INTO SOMETHING THAT LOOKS MORE LIKE AN ACTUAL dOCKERFILE RATHER THAN
TRYING TO DO EVERYTHING UP-FRONT BEFORE YOU EVEN KNOW IF IT'S GONNA WORK INSTEAD
OF COMMUNICATING BY TELEGRAM MAYBE I SHOULD INSTALL DOCKERSHIT AND USE THAT YEAH
ITS PRETTY EASH YOU JUST TYPE `uvx dockershit` APPARENTLY AND IT'LL BE READY FOR
USE IN UNDER A SECOND AND WILL MOSTLY WORK BUT MIGHT BE BUGGY BECAUSE ITS NEWISH
AND THE DEVELOPER WROTE IT IN ANGER AND DOESN'T SEEM TO TAKE IT SERIOUSLY BUT IT
IS WORTH A TRY BECAUSE IF YOU WASTE TIME HERE AT LEAST IT IS WASTED DIFFERENTLY.

Usage

Quickest way is run it in uv (either pip install uv or follow their instructions). Or use pip install dockershit or pipx dockershit. It's on pypi.

⚠️ IT EDITS DOCKERFILES SO USE SOURCE CONTROL ⚠️

By default it'll create or append to a Dockerfile in your pwd. Earlier versions also delete stuff, current ones might comment things out. Don't say you weren't warned.

uvx dockershit ubuntu:latest

It uses Podman when available, falling back to Docker. Choose one explicitly with --engine podman or --engine docker.

  • 🔢 type some commands, then exit or quit
  • 👀 look in your pwd for a Dockerfile, notice the RUN lines - they're the commands that worked (zero exit code)
  • 💣 commands that failed or made no changes are commented out
  • 🔃 arrow keys and ctrl+r work, history is in Dockerfile.history
  • ⬅️ commands starting with a space don't get added to the file, but they do go to the .history file
  • #️⃣ comments e.g. # wtf delete the above go to the Dockerfile unless they start with a space i.e. # subscribe and like, like and subscribe
  • ADD, COPY and other docker shit get added too, and the image is rebuilt between each command
  • #️⃣ if a command fails, you'll get a commented out line instead
  • 🚶 cd changes your WORKDIR, and WORKDIR changes your cd
  • 🐛 use --debug if you want to see it rebuilding
  • ⛓️‍💥 if you break your Dockerfile it'll exit (it rebuilds after every command) and currently deletes the broken line
  • 🚫 your Dockerfile and its history are excluded from the context
  • 🪈 you can use it with pipe like cat whatever | dockershit
  • 💩 yeah it runs everything twice, which is an embarrassment - in future I'll make it just run in docker, but pull requests are welcome

License

WTFPL with one additional clause:

  1. Don't blame me!

Links

TODO

  • CI build and deploy
    • release docs to bitplane.net
    • build and post to pypi on a tag
  • record a nice video using type.py
  • restructure input so it's a nice UI
    • use textual?
  • remove double WORKDIR entries by combining them
  • deal with ENV and ARG - passing them in on the command line.
  • add DS commands or whatever it ends up being called
    • use argparse
    • edit, to edit the current file (in git editor?)
    • squash, combine run steps with && \

Release files for dockershit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dockershit 0.2.0
File Size Uploaded
dockershit-0.2.0.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dockershit 0.2.0
File Interpreter ABI Platform
dockershit-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 20.1 kB

Release files / dockershit-0.2.0.tar.gz

Download URL dockershit-0.2.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2970a0d2d15f2ceab66407e75f34b8770aeec6dec64a6713d982124aacfea0d5
BLAKE2b-256 checksum
How to use checksums
2268bda42f5467e3fcca6c2129445e727e56ce8adcdf8d9b2a66d3ca741b253e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / dockershit-0.2.0-py2.py3-none-any.whl

Download URL dockershit-0.2.0-py2.py3-none-any.whl
Size 10.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
cc0121de967691c70897e56fb72a764f1004251064a8d9a93b657d680de787d4
BLAKE2b-256 checksum
How to use checksums
154c4799e6daddaff2eb0ff0208d5f39022a103e38155fe67002d61dc1912d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page