http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Dockerize http-server

Open mtozlu opened this issue 3 years ago • 3 comments

Dockerization of http-server

Relevant issues

Closes #724

Contributor checklist
  • [ ] Provide tests for the changes (unless documentation-only)
  • [x] Documented any new features, CLI switches, etc. (if applicable)
    • [ ] Server --help output
    • [x] README.md
    • [x] doc/http-server.1 (use the same format as other entries)
  • [x] The pull request is being made against the master branch
Maintainer checklist
  • [ ] Assign a version triage tag
  • [ ] Approve tests if applicable

Maintainers will do the building, tagging and pushing docker images. These instructions are only for maintainers to release a new version in docker hub;

Building and Tagging the Docker Image

  • Make sure to checkout the desired version/branch before building docker image for that version
  • Run docker build -t {your-username}/http-server:{new-version} -t {your-username}/http-server:latest . in project root folder. This builds and tags the docker image with "latest" tag and also with the version you provide.

Pushing the Docker Image

  • After successful build, you can push all tags to your docker repository
  • Push the version tag: docker push {your-username}/http-server:{new-version}
  • Push the "latest" tag: docker push {your-username}/http-server:latest

Note: I already have the http-server images built in docker hub in my own repository (which is tozlu/http-server), if you would like to maintain docker images in your own repository, please change README and the build/push scripts above to reflect your username for docker hub.

mtozlu avatar Jan 11 '22 08:01 mtozlu

@mtozlu Have you try running the final bin with Google Distroless images?

FROM gcr.io/distroless/nodejs:16

gaby avatar Jan 16 '22 16:01 gaby

@gaby No. But it looks cool. Should I switch to it? What are the benefits over alpine?

mtozlu avatar Jan 17 '22 07:01 mtozlu

@gaby No. But it looks cool. Should I switch to it? What are the benefits over alpine?

If it runs fine, I would say yes.

gaby avatar Jan 17 '22 23:01 gaby