DEV Community

Cover image for [FAST] The Super Flash Docker Command
Everton Tenorio
Everton Tenorio

Posted on • Edited on

[FAST] The Super Flash Docker Command

Today's Fast and Simple Tip is about docker.

Sometimes, I invoke the super flash docker like this:

docker run -dt --rm --entrypoint ./app/run.sh --name same-name -v $(pwd):/app -p 8080:8080 node:20-alpine
Enter fullscreen mode Exit fullscreen mode

The run.sh could be something like:

#!/bin/sh

cd /app
npm i ...
etc ...
npm run serve -- --host 0.0.0.0
Enter fullscreen mode Exit fullscreen mode

Less need for building, useful for real-time testing of the app being developed, on-demand. Additionally, if something goes wrong, the --rm flag will remove the container when stopped, and with --entrypoint ./app/run.sh, I customize how the container runs without relying on the original entry point of the image. Nothing against Dockerfile.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay