fake-gcs-server
fake-gcs-server copied to clipboard
Ability to configure server using environment variables
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.
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
@fsouza mind if I pick up this issue?
@fsouza mind if I pick up this issue?
Go for it!
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.