[GH-ISSUE #561] Ability to configure server using environment variables #103

Closed
opened 2026-03-03 12:08:18 +03:00 by kerem · 6 comments
Owner

Originally created by @lisfox1 on GitHub (Aug 26, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/561

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.

Originally created by @lisfox1 on GitHub (Aug 26, 2021). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/561 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.
kerem 2026-03-03 12:08:18 +03:00
Author
Owner

@tustvold commented on GitHub (Sep 2, 2022):

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

<!-- gh-comment-id:1235085458 --> @tustvold commented on GitHub (Sep 2, 2022): 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
Author
Owner

@mikechernev commented on GitHub (Jan 11, 2023):

@fsouza mind if I pick up this issue?

<!-- gh-comment-id:1378433748 --> @mikechernev commented on GitHub (Jan 11, 2023): @fsouza mind if I pick up this issue?
Author
Owner

@fsouza commented on GitHub (Jan 11, 2023):

@fsouza mind if I pick up this issue?

Go for it!

<!-- gh-comment-id:1378520071 --> @fsouza commented on GitHub (Jan 11, 2023): > @fsouza mind if I pick up this issue? Go for it!
Author
Owner

@onarres commented on GitHub (Sep 1, 2023):

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.

<!-- gh-comment-id:1703469304 --> @onarres commented on GitHub (Sep 1, 2023): 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.
Author
Owner

@ota2000 commented on GitHub (Mar 8, 2025):

I've continued @vichle ’s work from #1608 and expanded it in #1925 to support all configuration flags with environment variables.

This enhancement improves usability in containerized environments like GitHub Actions service containers.

Key points:

  • Uses envVarOrDefault helper
  • Maintains command-line flag compatibility
  • Follows FAKE_GCS_* naming pattern

Your feedback and review would be greatly appreciated!

<!-- gh-comment-id:2707752581 --> @ota2000 commented on GitHub (Mar 8, 2025): I've continued @vichle ’s work from #1608 and expanded it in #1925 to support all configuration flags with environment variables. This enhancement improves usability in containerized environments like GitHub Actions service containers. Key points: - Uses envVarOrDefault helper - Maintains command-line flag compatibility - Follows FAKE_GCS_* naming pattern Your feedback and review would be greatly appreciated!
Author
Owner

@ota2000 commented on GitHub (Feb 15, 2026):

This has been addressed in v1.54.0 via #1925. The server now natively supports configuration through environment variables. Closing this issue.

<!-- gh-comment-id:3904303112 --> @ota2000 commented on GitHub (Feb 15, 2026): This has been addressed in v1.54.0 via #1925. The server now natively supports configuration through environment variables. Closing this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#103
No description provided.