|
Size: 2815
Comment: Docker links, note about macos
|
Size: 2875
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 21: | Line 21: |
| RUN apt-get update RUN apt-get install -y bzr python3-dev python3-pip python-dev python-pip python-virtualenv |
RUN apt-get update && \ apt-get install -y bzr python3-dev python3-pip python-dev python-pip python-virtualenv |
| Line 25: | Line 25: |
| RUN apt-get install -y nodejs npm RUN npm install -g less RUN ln -s /usr/bin/nodejs /usr/bin/node |
RUN apt-get install -y nodejs npm && \ npm install -g less && \ ln -s /usr/bin/nodejs /usr/bin/node |
| Line 61: | Line 61: |
| sudo docker build -t mailman . | sudo docker build -t mailman3 . |
| Line 69: | Line 69: |
| sudo docker run mailman | sudo docker run mailman3 |
| Line 88: | Line 88: |
| Or, if you want to use a single line to generate that url, try this: | Or, if you want to use a single line to generate that url and you're only running that one container, try this: |
This page is a scratchpad for Terri's Dockerfile, which sets up a very default version of Mailman in your container so that you can try out Mailman 3 suite. Suggestions and instructions for use welcome!
Prerequisites
To use this, you will need to have Docker set up. They have docker setup instructions for many different platforms
The Mailman 3 Suite Dockerfile
#########################################
# Dockerfile to setup GNU Mailman Suite
# Based on Ubuntu
#########################################
# Set the base image to Ubuntu
FROM ubuntu
# File Author / Maintainer
MAINTAINER Terri Oda
# Update the sources and install some basic python stuff
RUN apt-get update && \
apt-get install -y bzr python3-dev python3-pip python-dev python-pip python-virtualenv
# Get the nodejs stuff
RUN apt-get install -y nodejs npm && \
npm install -g less && \
ln -s /usr/bin/nodejs /usr/bin/node
# Set the default directory where CMD will execute
WORKDIR /mailman3
# Get Mailman Bundler
RUN bzr branch lp:mailman-bundler
# Get buildout, go into Mailman Bundler and build
RUN pip install zc.buildout
WORKDIR /mailman3/mailman-bundler
RUN buildout
# Set up virtualenv
RUN virtualenv venv
RUN . venv/bin/activate
# Expose ports
EXPOSE 8000
# Prep some stuff
RUN ./bin/mailman-post-update
RUN ./bin/mailman-web-django-admin createsuperuser
RUN ./bin/mailman start
# This sets the django webserver up to not only run, but binds it to all interfaces, port 8000
ENTRYPOINT ./bin/mailman-web-django-admin runserver 0.0.0.0:8000
Building the docker image
Copy the content above into a file named Dockerfile in a directory, and then run the following command:
sudo docker build -t mailman3 .
This will take some time to build a docker image with the required steps.
Starting the container and mailman3 suite
sudo docker run mailman3
This will start the mailman docker container.
Then find out the container id by following command
sudo docker ps
You can find out the ip using
sudo docker inspect hash_of_docker"
For example I can open "http://172.17.0.15:8000/" in my browser to view Mailman3.
Or, if you want to use a single line to generate that url and you're only running that one container, try this:
echo "http://$( docker inspect $( docker ps | tail -n 1 | awk '{ print $1; }' ) | grep -i ipaddress | awk '{ print $2; }' | sed 's/[",]*//g' ):8000/"Mac OS X users
The container seems to run without incident on MacOS X, but you can't seem to access it from a local browser for some reason. If anyone can help debug this, we would very much appreciate help!