Instructions for Docker and Raspian

This commit is contained in:
Deon George
2018-09-11 23:10:04 +10:00
parent 776f6cc408
commit 675dc31e25
9 changed files with 157 additions and 7 deletions

43
source/_posts/docker.md Normal file
View File

@@ -0,0 +1,43 @@
---
title: Installing Docker on a Pi
date: 2018-09-02 22:43:01
thumbnail: /images/docker.png
comments: false
tags:
- Setup
categories:
- Install
- Docker
---
## Intro
Installing Docker on a Pi is super easy also.
First make sure your Raspian is up to date
```
sudo apt-get update
sudo apt-get upgrade
```
Then, all you need to do is run this.
```
curl -sSL https://get.docker.com | sudo sh
```
And voila, docker is installed:
```bash
pi@raspian:~$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
```
Now, you can run [my Mystic BBS](/2018/09/01/mysticbbs/) image or [my MBSE BBS](/2018/09/04/mbse) image.

54
source/_posts/mbse.md Normal file
View File

@@ -0,0 +1,54 @@
---
title: Installing MBSE BBS in Docker
date: 2018-09-04 13:07:50
thumbnail: /images/mbse.png
categories:
- Docker
- MBSE BBS
tags:
- Docker
- BBS
---
The following is the instructions on how to install [MBSE BBS](http://sourceforge.net/projects/mbsebbs) in a Docker Container. These instructions have been compiled using Docker on a Raspberry Pi. I'll provide instructions in another post on how to get Docker installed.
My image is available in my Docker Registry and can be obtained by using `docker pull registry.leenooks.net/leenooks/mbse:1.0.7.8`. You can use this image to run a container using `docker run`, or you can use it in a *swarm*, if you have multiple hosts. I actually use Docker Swarm myself.
**NOTE**: Its important that you separate "data" from the "application" and provide a persistent storage path for your container (otherwise if you recreate your container, you'll loose your data!). On my setup my container persistent storage is storage in `/srv/docker/[CONTAINER]/data`. In the parent path (/srv/docker/[CONTAINER]) I keep my scripts and tools for managing the container and starting it - and since I use Docker Swarm, that is where my `.yml` file is.
## Preparation
1. Download your favourite Linux OS and install
2. Install Docker
3. Pull the MBSE container with
```
docker pull registry.leenooks.net/leenooks/mbse:1.0.7.8
```
4. Create your persistent storage destination
```
mkdir -p /srv/docker/mbse/data
```
## Starting
5. Start your container with
```
docker run -d --rm -p 10023:23 -v /srv/docker/mbse/data:/opt/mbse/data --name=mbse leenooks/mbse:1.0.7.8
```
The first time the container starts, it will create sub directories and fill your data directory.
The options on this command line are:
<table><tr><th style="width: 20%">Option</th><th>Reason</th></tr><tr><td>-d</td><td>Run the container in the background</td></tr><tr><td>-p</td><td>Port mapping from the host:container. So using 10023:23 will mean any incoming connections on the *host* to port 10023 will be sent to the *container* on port 23. This will enable you to telnet into your MBSE.</td></tr><tr><td>-rm</td><td>Means the container will be destroyed when it is stopped. (No problem if *-v* is used below.</td></tr><tr><td>-v</td><td>Volume mapping from the host:container. A value of /srv/docker/mbse/data:/opt/mbse/data means that any data in the *container* written to /opt/mbse/data, will be stored on the *host* /srv/docker/mbse/data.</td></tr></table>
There are other options you may prefer to use, for example, instead of `--rm`, you may want to use `--restart=always`.
## Configuration
6. Now your container is running, jump into it and start configuring.
```
docker exec -itu mbse mbse /bin/bash
bin/mbsetup
```
If you need any help, [login](/2018/08/31/chinwag/) to my BBS and send me a message, or if you use another BBS, or a Sysop of a BBS and connected to one of the networks I'm connected to, you can send me a Netmail. See the list of [networks](/networks) that I'm already connected to.

View File

@@ -7,6 +7,7 @@ categories:
- MysticBBS
tags:
- Docker
- BBS
date: 2018-09-01 12:00:00
---
[Mystic BBS](http://mysticbbs.com) is great software to get up and running and get (back) into the BBS scene.
@@ -18,7 +19,7 @@ If you would like to get up and running quickly, I've created some Docker Images
There are two images:
<table><tr><th width="20%">Name</th><th width="80%">Information</th></tr><tr><td>armv7l</td><td>This image is a clean installation of Mystic BBS as provided by the upstream developer. It does have the pre-requisites so that spell is enabled and cryptlib is also installed so that you can use SSH based connections.</td></tr><tr><td>armv7l-extras</td><td>This image extends the base image and provides some doors and utilities.</td></tr><tr><td>x86_64</td><td>Just like the image above, however, this is for Intel Linux platforms.</td></tr><tr><td>x86_64-extras</td><td>This image extends the base image and provides some doors and utilities.</td></tr></table>
To get the images, just install docker onto your linux platform, and then do
To get the images, just install docker onto your Linux platform, and then do
`docker pull registry.leenooks.net/leenooks/mysticbbs:1.12a39-[TAG ABOVE]`

34
source/_posts/raspian.md Normal file
View File

@@ -0,0 +1,34 @@
---
title: Installing Raspian on a Pi
date: 2018-09-01 22:26:46
thumbnail: /images/raspian.jpg
comments: false
tags:
- Setup
categories:
- Install
- Raspian
---
## Intro
Installing Raspbian on a Pi is super easy. First get hold of [Raspbian](https://www.raspberrypi.org/downloads/raspbian). I use the “Stretch-Lite” version, as it is smaller and I don't need a GUI.
Youll need to use a tool to write the image to an SD card. If you have Linux - you can use Linux's dd command. If you use Windows or a Mac, (or you want a GUI for Linux), you can use [etcher](https://etcher.io/).
### You have two options:
1. Basic
A basic install means that you install Raspbian and it consumes the complete capacity of your SD card. This is by far the easiest and less complex setup.
The image itself as about 1.5G, and when you install it on a (larger) SD card, when Raspbian first boots, it will automatically re-partition the SD card so that the root partition consumes the remaining capacity of the SD card and reboot. On the subsequent reboot it will automatically resize that file system so that it now consumes that remaining capacity.
2. Advanced
An advanced install means that you want to control your file system layout and potentially use more mount points and/or some block devices. I went through this process because I wanted to install [glusterFS](https://www.gluster.org/) on my Pi(s) so that I can share a replicated file system with more than 1 Pi. I needed this because I wanted to use [Docker Swarm](https://docs.docker.com/engine/swarm/) (where your docker containers can float between Pis) and glusterFS provides the consistent persistent storage for those containers. And since glusterFS provides redundancy options, it means I can take a Pi offline (or in case it dies) and my BBS will start on another Pi.
To do this install, I modified the Raspbian image, so that it wouldn't resize the root file system after a reboot.
You can achieve this by removing `init=/usr/lib/raspi-config/init_resize.sh` in cmdline.txt (on the boot partition) - it should be at the end of the line.
Now you can setup [Mystic BBS](http://www.mysticbbs.com/), [MBSE BBS](http://sourceforge.net/projects/mbsebbs) or your favourite BBS software, or follow [my Docker installation](/2018/09/02/docker) if you want to run your BBSs in docker.