kwerle / ide-ruby

Atom package used to integrate https://github.com/kwerle/ruby_language_server with Atom. Development happens on the develop branch. Production is master.
23 stars 6 forks source link

Running on OSX/with Docker-Machine #19

Closed 3wille closed 5 years ago

3wille commented 5 years ago

Hey there, I am trying to run this on OSX with docker-machine. I am not sure on which system you are working. However, I'd need to pass some ENV-vars to the docker command. Are you using this too or do you have any idea how this could be achieved?

I didn't find any resources on setting ENV-vars in atom in general. Setting them in the "Docker Path" is producing errors.

Thanks in advance, Freddy

kwerle commented 5 years ago

What environment variables do you need to set? Because if that seems like a real thing that is needed it could be added...

I think that you may be able to hack what you want my changing the name of the container. Or by customizing the container yourself. For example: Image Name -E MY_THING=something kwerle/ruby_language_server:latest

or build your own container based on kwerle/ruby_language_server:latest and call it custom_ruby_language_server and then reference that.

3wille commented 5 years ago

Sorry for being unclear, but you misunderstood me there. I don't need variables for the container but for the docker command itself. With docker-machine the docker daemon runs in a VM (because docker only runs on linux). You can see the documentation with an example of the vars here: https://docs.docker.com/machine/reference/env/

I am not sure whether there is a better way to support docker-machine than to allow setting ENV vars.

kwerle commented 5 years ago

OK, still not clear.

Exactly what variables are you trying to pass? How would you run it on the command line?

3wille commented 5 years ago

Example from the above mentioned documentation:

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.104:2376"
export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs"
export DOCKER_MACHINE_NAME="default"
docker {some_command}

In a shell environment one can use eval "$(docker-machine env default)" to set those variables to the correct values.

kwerle commented 5 years ago

Then I think I would set my Docker Path to something like /Users/\<you>/bin/atom_docker.sh

atom_docker.sh

#!/bin/sh
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.104:2376"
export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs"
export DOCKER_MACHINE_NAME="default"
docker $*

or something to that effect.

3wille commented 5 years ago

That's a good idea. It seems to work, at least it is not showing an error anymore. So, thanks for your help 👍