fake-gcs-server icon indicating copy to clipboard operation
fake-gcs-server copied to clipboard

Ability to configure server using environment variables

Open lisfox1 opened this issue 3 years ago • 4 comments

When running this service inside a docker container it would be handy to be able to configure it using env vars instead of cli parameters.

lisfox1 avatar Aug 26 '21 10:08 lisfox1

This would be especially useful when using Github Actions which for some inexplicable reason do not support passing command line arguments to services - https://github.com/orgs/community/discussions/26688

tustvold avatar Sep 02 '22 05:09 tustvold

@fsouza mind if I pick up this issue?

mikechernev avatar Jan 11 '23 09:01 mikechernev

@fsouza mind if I pick up this issue?

Go for it!

fsouza avatar Jan 11 '23 10:01 fsouza

I created my own docker wrapping the original so I could pass environment variables:

ARG VERSION=1.47.4

# https://github.com/fsouza/fake-gcs-server
FROM fsouza/fake-gcs-server:$VERSION

ENV GCS_SCHEME="http"
ENV GCS_PORT=9010
ENV GCS_URL="http://localhost"

EXPOSE $GCS_PORT

#Remove the original ENTRYPOINT ["/bin/fake-gcs-server", "-data", "/data"] so we can use variables on the CMD and they get interpreted correctly
ENTRYPOINT []

CMD /bin/fake-gcs-server -data "/data" -scheme $GCS_SCHEME -port $GCS_PORT -external-url "$GCS_URL:$GCS_PORT"

I don't know how to add anything to the main repo to easily add this functionality other than creating a separate docker image that supports this.

onarres avatar Sep 01 '23 23:09 onarres