Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Dockerfile and updated README with instructions to run using docker #937

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ruby:3.2.2-alpine

WORKDIR /var/cache/showoff

RUN apk add make gcc musl-dev g++ gcompat && gem install nokogiri showoff

ENTRYPOINT showoff serve
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ you'll need to install both Ruby and the Ruby DevKit for compiling native extens
gem install showoff


Alternatively, you can run Showoff using docker:

docker run --rm -it -p 9090:9090 -v $(pwd):/var/cache/showoff binford2k/showoff


Or build the image yourself:

docker build -t Dockerfile local/showoff .
Copy link

@lvoss lvoss Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I just stumbled upon this project and thankfully over your Merge Request.
I did try out your Dockerfile. It works like a charm. The "old" Dockerfile doesn't work for me, I run into the exact same error as you mentioned above.
There is an error though in this line, the flag "-f" is missing. The following would be correct:

docker build -f Dockerfile -t local/showoff .

I would also suggest overwriting the Dockerfile under build/Dockerfile as you mentioned.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lvoss Glad you found this helpful.

As for the -f flag, I may be missing something, but I believe the default value of -f is "Dockerfile" and that -f is only needed if using a name other than "Dockerfile". I'd be interested to see the error you're getting if you're not able to build without the -f flag and the file is named "Dockerfile". Are you using the latest version of the docker CLI?

And as for where to put this Dockerfile, I'm waiting to hear what the maintainer wants to do. I agree replacing the build/Dockerfile may be best, since it doesn't appear to be working properly.

Copy link
Author

@jamesmortensen jamesmortensen Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I see what the problem is. I have the -t in the wrong place. I'll fix it. Thanks for catching it. Apparently, I was missing something.



And run using the locally built image:

docker run --rm -it -p 9090:9090 -v $(pwd):/var/cache/showoff local/showoff

## Documentation

Please see the user manual on the [Showoff homepage](http://puppetlabs.github.io/showoff)
Expand Down