Skip to content
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

[Feature Request] Provide Docker images #49

Open
TylorS opened this issue Aug 7, 2020 · 4 comments
Open

[Feature Request] Provide Docker images #49

TylorS opened this issue Aug 7, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@TylorS
Copy link

TylorS commented Aug 7, 2020

Is your feature request related to a problem? Please describe.
Not a problem per se, but just a thought for lowering the barrier to entry.

Describe the solution you'd like
It'd be convenient to publish a docker image for Odin that can be used for easy deployments and quick installation. Perhaps even a docker-compose.yml could be added to the repository to facilitate setting up Odin + the communication with Mongo and later on for other databases that are supported.

Describe alternatives you've considered
Not much at this time

Additional context
Not much at this time

@TylorS TylorS added the enhancement New feature or request label Aug 7, 2020
@TylorS
Copy link
Author

TylorS commented Aug 7, 2020

I had a whirl at spinning things up with Docker..but I believe the issue comes from the makefile being tied to systemd which is not available within the docker images for ubuntu as Docker is about process isolation and not OS virtualization.

The specific error is

System has not been booted with systemd as init system (PID 1). Can't operate.

Here's the Dockerfile I was attempting to create

FROM ubuntu:18.04

WORKDIR /odin
COPY . /odin

# Get some prerequisites
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata wget build-essential sudo apt-utils systemd

# Install Go
RUN wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
ENV PATH=$PATH:/usr/local/go/bin
RUN go version

# Build Odin
ENV ODIN_EXEC_ENV True
ENV ODIN_MONGODB "mongodb://localhost:27017"
RUN make

# Make sure odin's running
CMD systemctl status odin

@theycallmemac
Copy link
Owner

Originally working on this project I aimed to provide Docker images, I also ran into the issue of systemd.

@ylmcc
Copy link
Collaborator

ylmcc commented Mar 2, 2021

After some googling and tinkering with the build file in this thread I was able to get the container to build however I have yet to launch it

I came across this website which I changed systemctl status odin to /etc/init.d/odin status.

After building the image after a countless amount of times I was greeted with:

Step 15/15 : CMD ["/etc/init.d/odin", "status"]---> Running in 64903e04830c  
Removing intermediate container 64903e04830c ---> 7e7c90c5d81d  
Successfully built 7e7c90c5d81d  

Dockerfile as follows:

FROM ubuntu:18.04
LABEL author="Kyle McCann <[email protected]>"

WORKDIR /home/kyle/testing
COPY . /odin-testing

# Get some prerequisites
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata wget build-essential sudo apt-utils systemd

# Install Go
RUN wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
ENV PATH=$PATH:/usr/local/go/bin
RUN go version

# Build Odin
ENV ODIN_EXEC_ENV True
ENV ODIN_MONGODB "mongodb://localhost:27017"
RUN ls /odin-testing
RUN sudo make /odin-testing

VOLUME ["/home/kyle/testing/"]
CMD ["/etc/init.d/odin", "status"]

(Sorry if my formatting is awful, first time commenting on an issue.)

@theycallmemac
Copy link
Owner

No worries on the formatting. I can take some time to run this, if it's building I think you're good to open a PR on this and reference this issue. Once you've done that I can take time to test it out 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants