Introduction
This tutorial will walk you through creating an application image for a static website that uses the Express framework and ...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for the great introduction to Docker!
If you follow the tutorial and like me have the error
Error response from daemon: Dockerfile parse error line 4: unknown instruction: /HOME/NODE/APPduring
docker build, then replace lines 3,4 inDockerfilewith one line.From
to
Looks like that was a formatting error in the markdown – should be fixed now. That instruction is definitely all one line. Thanks for catching!
To keep the image as small as possible you can delete the cache npm builds
And by putting "fix" settings that don't change, like
towards the beginning of the Dockerfile you can sometimes save build time because docker can build upon existing layers that didn't change.
If you can install
podman, you no longer need a sudo account as podman can work without root access. It works just likedocker, using the very same parameters. You can evenalias docker=podman.Also, why creating
package.jsonby hand?npm initcan create it for you so you wonʼt suffer from possible typos.Thanks for sharing your knowledge!
One thing I am curious about, why is there two
COPYon Dockerfile? Is it the first one neccesary?Hi! That is a typo – thanks for catching! I've updated the code above.
Do we make static websites with express?
thank you!
Thanks for the easy to understand guide. I needed this for an upcoming project.