Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Add Dockerfile #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Dockerfile #3

wants to merge 1 commit into from

Conversation

Shihta
Copy link

@Shihta Shihta commented Jul 16, 2019

This repo might need a Dockerfile
In this way, user could launch service easily

Copy link
Contributor

@tadeboro tadeboro left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. But before we can merge this, we would need at least some documentation about how to use the added Dockerfile and how to start the mock server using Docker.

Another thing that bothers me about the current Dockerfile is the fact that we copy the recordings into the image, which is far from ideal. I would expect that the docker image only has the software installed, and the end-user will supply the recording.

@sstanovnik Any suggestions on how we should implement this? I would probably mount the recording that I want to serve into the container somehow, but if there is a better way of doing this, I will gladly adopt. And I am sorry to drag you into this debate, but you are my go-to person for Docker-related things.

@sstanovnik
Copy link
Member

I think the main question here is what the dockerfile is for. The main usage I see is to avoid having to install ruby et al, instead just encapsulating this into an easily removable/stoppable/restartable container.

If there are any plans to allow the mock server to be configured, e.g. to switch the dataset, baking things inside the image could be a solution, but only if also offering a user-configurable directory for additional recordings and if this was planned to be distributed standalone, without this repository. Otherwise, yes, mounting a single recording when running the container is the way to go imo.

I'd use

...
WORKDIR /app
ADD Gemfile .
RUN bundle
ENTRYPOINT ... --port 80 redfish-recording
...

to build the image and

docker build -t redfish-recordings
docker run -v ./lenovo-sr650/:/app/redfish-recording -p 80:80 redfish-recordings

to run the image. This would be the same as running the commands already in the readme, but would not require ruby and friends.

I'd also avoid running SSL inside the application, instead relying on a reverse proxy. But that's just personal preference.

@Shihta
Copy link
Author

Shihta commented Jul 17, 2019

Thanks for your advice
I hope to provide a ready-to-use recording image.
It includes all recordings in this repo so user could directly launch a recording without other source.

Suppose there are more than one recordings in this repo, e.g. lenovo-sr650, hp-e2124, qct-d52bq

  1. launch a demo redfish server, you could use default configuration by docker run redfish-recordings
  2. launch qct redfish server, you could simply add a environment variable: docker run -e RECORDING=qct-d52bq redfish-recordings
  3. launch a redfish server with your recording, you could use docker run -v $PWD/newtype:/app/newtype -e RECORDING=newtype redfish-recordings

@tadeboro suggests to provide a clean image without any recording, I totally agree that.
however, I think it's appropriate to put this kind of image in redfish-tools-ruby
since this repo is named recordings, it doesn't seem strange to put a docker image which contains recording.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants