-
Notifications
You must be signed in to change notification settings - Fork 2k
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 Dockerfile to run service in a container #76
Add Dockerfile to run service in a container #76
Conversation
Fixes mattermost-community#75 NOTE: At the moment, the focalboard version is hard-coded and there is a bug that means the download is not actually a .tar.gz file, but a .tgz.gz file inside a .zip file.
Why does this do a full system upgrade in the container? Doesn't that bloat up the container size extremely? |
/check-cla |
Hi @proffalken ! Thank you for your PR! Sorry about the spam to set up the check-cla command from me. |
Nope, it updates a single package at the moment and brings it inline with the latest security releases. If I were installing Ubuntu-Desktop or similar then yes, that would absolutely add bloat, but this purely ensures that we are running the latest versions of any package that is already installed to ensure we're patched and up to date. At most, I'd expect it to add a couple of Kb to the image. |
@metanerd No worries, is there a link to the CLA somewhere so I can sign it? I'm more than happy to do so! |
Glad to hear that @proffalken ! The CLA form can be found here: https://mattermost.org/mattermost-contributor-agreement/ |
Great! All signed @metanerd - looking forward to getting involved! |
/check-cla |
Dockerfile
Outdated
RUN apt upgrade -y | ||
RUN apt install -y wget tar gzip unzip file | ||
RUN wget https://releases.mattermost.com/focalboard/0.5.0/focalboard-server-linux-amd64.tar.gz | ||
RUn unzip -o focalboard-server-linux-amd64.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this RUn
typo throw a syntax error?
Also, really this should be one run command so the end result isnt a bunch of unnecessary layers
FROM ubuntu:latest
RUN apt update \
&& apt install -y wget tar gzip unzip file \
&& wget https://releases.mattermost.com/focalboard/0.5.0/focalboard-server-linux-amd64.tar.gz \
&& tar -xvzf focalboard-server-linux-amd64.tar.gz \
&& mv focalboard /opt \
&& rm -f focalboard-server-linux-amd64.tar.gz # cleanup the unnecessary zip to reduce end container size
EXPOSE 8000
WORKDIR /opt/focalboard
CMD /opt/focalboard/bin/focalboard-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot on the typo, but no, it doesn't throw an error.
As far as the "single command" is concerned, I'd be happy to condense it down to 2 commands - one for the OS and one for Focalboard? Seems like that way we only update the OS layer if it changes, regardless of the application version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasonraimondi - I've split it out into two RUN statements instead, would appreciate your feedback?
This is really great! Can't wait to try it with Docker 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @proffalken! this is awesome. I clearly see adding changes later to support environment variables to configure Postgres instead of SQLite. And clearly we have to fix the "zip/tgz" problem, but we can do it later.
Thanks! This is a great first iteration, now we have something to improve and make it more configurable. |
Summary
Add a Dockerfile to launch the application within a container.
NOTE: At the moment, the focalboard version is hard-coded and there is
a bug that means the download is not actually a .tar.gz file, but a
.tgz.gz file inside a .zip file.
This also assumes the use of SQLite as the database rather than PgSQL.
Ticket Link
Fixes mattermost/mattermost#75