Curseforge API as a docker secret
Trying to do my first MC Docker project, and want to use Secrets instead of env variables (not planning on republishing, but wanting to learn how to use secrets w Docker Compose)
Im using itzg/mc for server and backup
snippet of the relevant portion of the dockerfile yaml:
Any thoughts on what im doing wrong here?
In case its not obvious, trying to have a .txt in the same folder as the .yaml, which only contains the API key as an unencrypted string and nothing else. Then im wanting Compose to pick it up in the top level Secrets segment, so that i can be used by the Environment > CF_API_KEY, which as i understand, will end up in /run/secrets/
I've been following https://docs.docker.com/reference/compose-file/secrets/ and https://docs.docker.com/compose/how-tos/use-secrets/ as best as i can, but this is my first time.
The actual error i get now is:
And i get success/diff errors if im passing CF_API_KEY as plain text
Cheers!
Docker Documentation
Secrets top-level elements
Explore all the attributes the secrets top-level element can have.
4 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by paulydphd#0
I don't think
itzg/minecraft-server
supports reading the cf secret from a file (which is what you're attempting to tell it to do). With that being said, the curseforge api "secret" doesn't need to really be secret. (in fact, you're better off just doing a google search and using the api key embedded in the curseforge launcher)
If you really want to learn docker secrets, then fork the itzg image and add support for itokay fair enough - Ive realized the modpack my friends want to play is no longer being updated anyway, so ill take a static .zip instead of the auto installer anyway
Thanks!
!solved
Closed post!
Your post has been marked as solved!
Requested by paulydphd#0