Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Docker #9

Closed
wants to merge 2 commits into from
Closed

Docker #9

wants to merge 2 commits into from

Conversation

colinodell
Copy link

@colinodell colinodell commented Apr 9, 2017

This is an early attempt to get magnetico working in Docker (see #4)

If you have Docker installed, you can build and run the image with these commands:

docker build -t magnetico .
docker run -it --rm magnetico

Known issues which need to be resolved:

  • magneticod spews out several Belated TICK warnings (possibly related to Let user set the magneticod port #1? If we don't know the UDP port, we can't tell Docker to expose it to the host)
  • No search results appear (probably due to the above issue)
  • The web credentials are currently hard-coded to user / password. Would be nice if we could set those via environment variables instead

@offbyone
Copy link
Contributor

offbyone commented Apr 9, 2017

Consider #13 instead, which builds this as a pair of separate containers; that might be more flexible in the long run.

@boramalper
Copy link
Owner

I agree with @offbyone that a pair of separate containers might be a better choice.

@colinodell I will do the required changes but I didn't understand this:

The web credentials are currently hard-coded to user / password. Would be nice if we could set those via environment variables instead

The credentials can be set from the command-line while starting the program. Isn't it a better option than using environment variables which can lead to a mess quite easily?

@r4j4h
Copy link

r4j4h commented Apr 9, 2017

Regarding magneticod spews out several Belated TICK warnings (possibly related to #1? If we don't know the UDP port, we can't tell Docker to expose it to the host) Docker lets us specify port ranges.

EXPOSE 7000-8000

Expose reference
SO Syntax reference and SO Syntax w/ specific interface example

Hope that is helpful news :)

@colinodell
Copy link
Author

Consider #13 instead, which builds this as a pair of separate containers; that might be more flexible in the long run.

I usually do prefer separate containers for separate services. In this case I wonder how useful it is to have one container without the other, especially since they communicate via a shared database and not the network.

If you'd still prefer the two-image approach then feel free to close this :)

The credentials can be set from the command-line while starting the program. Isn't it a better option than using environment variables which can lead to a mess quite easily?

I've personally never encountered a mess using environment variables with Docker in this way. I know it's dead-simple to pass them into a command - I just didn't spend the time figuring out if that was doable with supervisord (which would not be needed if we went with #13)

Regarding magneticod spews out several Belated TICK warnings (possibly related to #1? If we don't know the UDP port, we can't tell Docker to expose it to the host) Docker lets us specify port ranges.

That does help somewhat, but it's still not ideal. Yes, we could define the entire range the application might use, but ultimately it's always going to use a single port, so I'd rather have the ability to configure which port I'm going to use (instead of tying up 1000 ports on the host because I have no way to pre-determine which port will be used).

@offbyone
Copy link
Contributor

offbyone commented Apr 9, 2017

FWIW the reason I looked at separate containers was because of the different resource needs; the magneticod container has different memory and CPU requirements, so it should be in a different container. Sharing data via the volume is pretty much why that feature exists.

@colinodell colinodell closed this Apr 18, 2017
@colinodell colinodell deleted the docker branch April 18, 2017 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants