New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variables into task.yaml #114

Closed
Daegalus opened this Issue Sep 8, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@Daegalus

Daegalus commented Sep 8, 2017

I am currently working on getting a CS:GO server up and running with Sonm. I have the docker container working, and it actually works in Sonm, but I can't properly pass in some variables to make it work 100%.

CS:GO server requires a Steam Token to work in non-lan mode. When I run docker normally, I used -e GSLT=<token> to pass it in. or I pass it in as part of the command docker run csgo /home/csgoserver/start.sh <token>

Either of these methods would work, but not currently possible with the tasks yaml. I looked through the code, and it seems you have tests for a command config value in the tasks yaml, but it is not hooked up or get passed into the container configs in insomnia. As for ENV the only place I see that is in Exec for the overseer or ExecCmd in the container. Neither of which seem to be used fro the tasks yaml method of launching.

Could we get ENV variables hooked up? I can try to submit a pull request myself, but I haven't had time to familiarize myself with the code, so it might be a while before I can comfortably provide a pull request.

Example env config:

task:
  container:
    # image name to start, requried
    name: daegalus/docker-csgo:latest
    env:
      - "GSLT=<token>"
      - "GAMEPORT=27015"
  resources:
      # number of CPU cores required by task, required param
      CPU: 1
      # amount of memory required by task, required param
      # You may use Kb, Mb and Gb suffixes
      RAM: 50Mb

https://docs.docker.com/engine/api/v1.29/#operation/ContainerCreate (Env)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment