Changes

Jump to navigation Jump to search
4,082 bytes added ,  12:57, 27 July 2023
Line 1: Line 1:  
{{WIP box}}
 
{{WIP box}}
 
Placeholder for anything to do with Docker (https://docker.com)
 
Placeholder for anything to do with Docker (https://docker.com)
{{Note box| All info is based on SME Server 9 only but I have just started to test on v10 - see notes below
+
{{Note box| The contrib has been built from the original notes and I use it to permanently run Rocketchat }}
Your host server must have internet access.
     −
Some testing below was originally done on a virtual SME9 under Virtualbox. Yes, Docker also run on VM's :-)
+
=== Version ===
 
+
{{ #smeversion: smeserver-docker }}
The contrib has been built from the original notes and I use it to permanently run Rocketchat.
  −
}}
      
'''You can discuss all things related to this page on the forums [http://forums.contribs.org/index.php/topic,51181.0.html here]'''
 
'''You can discuss all things related to this page on the forums [http://forums.contribs.org/index.php/topic,51181.0.html here]'''
Line 58: Line 55:     
===Contrib===
 
===Contrib===
There is a contrib that will set up a lot of this for you in the Reetp Repo:
+
yum --enablerepo=extras install epel-release.
 +
yum install smeserver-extrarepositories-docker-ce
 +
signal-event yum-modify
 +
yum --enablerepo=smecontribs,extras,epel install smeserver-docker
 +
signal-event post-upgrade;signal-event reboot
 +
 
 +
(Note the contrib is still in smetest)
 +
 
 +
====Avoiding conflicts====
 +
 
 +
docker-compose templates used:
 +
 
 +
smeserver-docker
 +
01version
 +
10HelloWorldTest
 +
 
 +
smeserver-rocketchat
 +
20rocketchat
 +
 
 +
====config entries====
 +
 
 +
config setprop docker iptables false/true - default false
 +
 
 +
  config setprop  docker DNS [192,168.10.1,8.8.8.8] - defaults to LocalIP
 +
 
 +
  config setprop  docker DockerNetwork [IP range eg 192.168.100.0/24] - defaults to dockers own choice. Range is not yet checked for validity.
 +
 
 +
There is an action to update the core files:
 +
 
 +
smeserver-docker-update
 +
 
 +
{{Note box| Note to self - probably needs quotes around "false" for iptables}}
 +
 
 +
config show docker
 +
status enabled/disabled - enabled by default
 +
iptables true/false - false by default to prevent docker manipulating iptables
 +
 
 +
config show containerd
 +
status enabled/disabled - enabled by default - called and used by docker
 +
 
 +
See if it works:
 +
 
 +
systemctl status docker
 +
 
 +
====Testing====
 +
 
 +
We can run docker directly but the preferred method is to use compose
 +
 
 +
curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
 +
chmod +x /usr/local/bin/docker-compose
 +
chgrp docker /usr/local/bin/docker-compose
 +
 
 +
A test compose file is installed.
 +
 
 +
cd /home/e-smith/files/docker/configs
 +
docker-compose up -d hello_world
 +
 
 +
Add your own templates to:
 +
 
 +
/etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml
 +
 
 +
or:
 +
 
 +
/etc/e-smith/templates-custom/home/e-smith/files/docker/configs/docker-compose.yml
 +
 
 +
To expand the template:
 +
 
 +
signal-event smeserver-docker-compose-update
 +
cd /home/e-smith/files/docker/configs
 +
docker-compose up -d my_hello
 +
 
 +
Using plain docker:
 +
 
 +
docker run hello-world
 +
 
 +
Other commands:
 +
 
 +
docker ps -a
 +
docker rm <id>
   −
https://wiki.contribs.org/User:ReetP
+
docker images
 +
docker rmi <id>
   −
Add the reetpTest repo:
+
==Things to do==
   −
yum --enablerepo=reetpTest,epel install smeserver-docker
+
Plenty
   −
Most of the settings in the Manual Installation below are replicated into the contrib with templates
+
===Challenges===
 +
* How to interact with localhost PAM or LDAP from within a container?
   −
====Docker Images====
+
I think that you can access localhost services by adding:
   −
These can be pulled using docker itself as per Manual Installation below. Note that some require a higher version of docker. Regrettably I can't change that!
+
--net="host" to docker run
   −
Alternatively you can create a docker-compose.yml file directly, or via templates, in:
+
This means any services on the docker container are equally valid 'localhost' services accessible from the server itself so you need to ensure the server is properly firewalled. See Issues below.
   −
/home/e-smith/files/docker/configs
+
* Many more...
   −
docker-compose will automatically run this at boot.
     −
Create you compose file and then run this from the configs directory
+
==Notes==
   −
docker-compose up -d
      
====Networking====
 
====Networking====
   −
{{Note box | See Issues and other comments further down re host/bridged networking}}
+
{{WIP box | This is still a work in progress. the following are notes for reference only}}
    
Docker attempts to guess what network to use and sets a bridged interface for it.
 
Docker attempts to guess what network to use and sets a bridged interface for it.
Line 92: Line 167:  
This allows access to any local services, and any ports in the container will appear locally
 
This allows access to any local services, and any ports in the container will appear locally
    +
v1 format
 
  --net="host"  
 
  --net="host"  
 +
 +
v2 + format
 +
 +
Docker
 +
--network host
 +
 +
Compose
 +
network_mode: host
    
This maps container port 80 to host port 8088
 
This maps container port 80 to host port 8088
Line 104: Line 188:  
  container.ip.add:8088
 
  container.ip.add:8088
   −
Using --net="host" means it is easier to connect to the container using the local IP address. Simple port forwarding/opening will suffice.
+
Using --network host means it is easier to connect to the container using the local IP address. Simple port forwarding/opening will suffice.
    
However, it exposes all ports on the container locally, and there may also be conflicts with local ports.
 
However, it exposes all ports on the container locally, and there may also be conflicts with local ports.
Line 119: Line 203:  
I am working on this currently but the LocalNetworking approach doesn't work. It probably need manipulation of the firewall with templates.
 
I am working on this currently but the LocalNetworking approach doesn't work. It probably need manipulation of the firewall with templates.
   −
==== Login to container====
+
=== Login to container===
    
If permitted, most containers can be logged into using this:
 
If permitted, most containers can be logged into using this:
   −
docker exec -t -i -u root <container_name> /bin/bash
+
docker exec -t -i -u root <container_name> /bin/bash
 +
 
 +
===SME Server specifics===
 +
By default Docker will store all images, containers and other data in:
 +
/var/lib/docker
   −
===Manual Installation===
+
For SME Server this is not ideal for we would like to incorporate all Docker data into the pre-defined backup procedure(s) that come with SME Server. The preferred location for Docker data would be:
 +
'''/home/e-smith/files/docker'''
   −
Note that most of the following is now in the contrib. See above.
+
===File permissions===
   −
Docker requires some RPM's that are not available in the default upstream repo's. So we need to enable the epel repo first. See ''[[epel]]''
+
You may have issues writing to local filesystems from Docker images.
   −
Then we can install Docker and it's dependencies:
+
First add something like this to your compose file
yum install docker-io --enablerepo=epel
      +
volumes:
 +
  - /opt/uploads/:/opt/uploads/
   −
Make the Docker service start at boot time:
+
You may need to find out what permissions are required.
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S95docker
  −
chkconfig docker on
  −
config set docker service
  −
config setprop docker status enabled
        −
====Configuration====
+
In RocketChat I had to add a dummy user and group like this
Docker comes with a configuration file located at:
  −
/etc/sysconfig/docker
  −
In this file you can set default parameters which are applicable to all containers run by Docker. By default it holds no arguments. All arguments can also be set manually when starting a container, in which case each individual container can have it's specific parameters.  To see a list all available arguments that can be used in the Docker configuration file enter:
  −
docker -h
      +
mkdir -p /opt/uploads
 +
chmod 0777 /opt/uploads
   −
====SME Server specifics====
+
I then could upload and check the ID that docker users. I thins case it was 65533
By default Docker will store all images, containers and other data in:
+
 
  /var/lib/docker
+
So I then did:
 +
  groupadd -g 65553 rocketchat
 +
useradd -s /sbin/nologin -u 65533 -d /dev/null -g rocketchat rocketchat
 +
chmod 0744 /opt/uploads
 +
 
 +
And then test again.
 +
 
 +
===Using a Docker image===
   −
For SME Server this is not ideal for we would like to incorporate all Docker data into the pre-defined backup procedure(s) that come with SME Server. The preferred location for Docker data would be:
+
You should generally be prefer to use docker-compose for images.
'''/home/e-smith/files/docker'''
     −
We want this to be the default location for all Docker data on SME Server, so we add the '-g' argument and the desired path to the storage location to the docker configuration file like this:
     −
# /etc/sysconfig/docker
+
==Building your own images==
#
+
* Notes
# Other arguments to pass to the docker daemon process
+
Manual, or..
# These will be parsed by the sysv initscript and appended
+
https://github.com/docker/fig
# to the arguments list passed to docker -d
  −
  −
other_args="-g /home/e-smith/files/docker -H unix:///var/run/docker.sock"
        −
Since the Docker service will always check this configuration file upon (re)start, it will automatically pick up the arguments you have provided and act accordingly. That also implies that you can have multiple (but ''not'' simultaneously) storage locations if you omit the configuration file and add arguments manually on the command line.
+
==Related articles of interest==
 +
* [http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/ Container storage and (re)size]
   −
The second argument '-H unix:///var/run/docker.sock' will tell Docker where to find it's socket to bind.
+
===Setting up a (Private) Docker repository===
 +
TBA
    +
* https://blog.codecentric.de/en/2014/02/docker-registry-run-private-docker-image-repository/
   −
It is ''important'' that you adjust the config file ''before'' you start using docker otherwise it will create it's default storage location in /var/lib/docker.
     −
You can still change the storage location in a later stage by copying all data to the new location you've defined with the -g argument.
      +
==='Proposal test image:'===
 +
An application that requires Java, PHP, Apache, MySQL and LDAP. The localhost MySQL and localhost LDAP should be used by the application. The application should be publicly available either on a subdomain or specific port on the FQDN. The application should only be available between 08:00AM until 19:00PM.
 +
All application data should be incorporated by the default SME Sever backup mechanisms, including the image itself.
   −
Once the above changes have been made, the Docker service can be started and Docker will create it's new storage layout in /home/e-smith/files/docker.
+
* Building the image based on centos6
service docker start
+
* Configure networking, bridges and ports
 +
* Start/restart and stop syntax of the application
 +
* Configure cron
   −
You can check if the docker deamon is running:
+
==General old notes==
service docker status
+
The following methods and notes are left for reference.
and if it created the storage layout correctly:
  −
ls -l /home/e-smith/files/docker/
     −
==Using a Docker image==
+
By default, there are pre-built images available from the official [https://registry.hub.docker.com/ Docker Hub]. In our examples we will use the pre-built centos7 image.
By default, there are pre-build images available from the official [https://registry.hub.docker.com/ Docker Hub]. In our examples we will use the pre-build centos6 image.
      
To get a list of all available Centos images you can use:
 
To get a list of all available Centos images you can use:
 
  docker search centos
 
  docker search centos
 
You will be flooded with available images from the Docker hub. This is because everyone can have a free account on Docker hub and create one repository for him/herself. We limit our testing to the official Centos repo. With all the other images, you are on your own and usage is at your own risk.
 
You will be flooded with available images from the Docker hub. This is because everyone can have a free account on Docker hub and create one repository for him/herself. We limit our testing to the official Centos repo. With all the other images, you are on your own and usage is at your own risk.
      
===Downloading a docker image===
 
===Downloading a docker image===
To download the centos6 image to your local server, issue the following command as root:
+
To download the centos7 image to your local server, issue the following command as root:
  docker pull centos:centos6
+
  docker pull centos:centos7
where the syntax is 'centos' as the main repository and 'centos6' the specific version. Would you issue only 'docker pull centos', then all centos versions will be downloaded. So be specific.
+
where the syntax is 'centos' as the main repository and 'centos7' the specific version. Would you issue only 'docker pull centos', then all centos versions will be downloaded. So be specific.
    
Once the image has been downloaded, you can check your local images by issuing:
 
Once the image has been downloaded, you can check your local images by issuing:
 
  docker images
 
  docker images
 +
 
The listing included the Image ID and Name. These are important to run additional commands when the container is running.
 
The listing included the Image ID and Name. These are important to run additional commands when the container is running.
       
===Running a docker container===
 
===Running a docker container===
Now that we have downloaded the centos6 image it's time to give it a spin. To start the cento6 container we can issue the following command:
+
Now that we have downloaded the centos7 image it's time to give it a spin. To start the cento6 container we can issue the following command:
  docker run -t -i --net="host" centos:centos6 bash
+
  docker run -t -i --net="host" centos:centos7 bash
This will tell docker to run the centos6 container interactively from the local centos repo, use the host network interface and start bash. After a few seconds you will be presented with the bash prompt inside the centos6 container:
+
This will tell docker to run the centos6 container interactively from the local centos repo, use the host network interface and start bash. After a few seconds you will be presented with the bash prompt inside the centos7 container:
 
  bash-4.1#
 
  bash-4.1#
 
and to check if we are really inside the centos6 container we can display the release version:
 
and to check if we are really inside the centos6 container we can display the release version:
 
  cat /etc/redhat-release
 
  cat /etc/redhat-release
 
which will result in:
 
which will result in:
  CentOS release 6.5 (Final)
+
  CentOS release 7.8 (Final)
 
From here you can use the normal commands like yum etc.
 
From here you can use the normal commands like yum etc.
   Line 221: Line 310:  
===Copy docker images===
 
===Copy docker images===
 
Docker images are stored on your local server. If you want to run the image on another machine you first have to take the image out of your local image repository and save the image in a transferable format. For this the ''save'' the image in .tar format. To get a listing of all available images on your local server:
 
Docker images are stored on your local server. If you want to run the image on another machine you first have to take the image out of your local image repository and save the image in a transferable format. For this the ''save'' the image in .tar format. To get a listing of all available images on your local server:
 +
 
  docker images
 
  docker images
 +
 
will result in (example):
 
will result in (example):
 +
 
  [root@sme9 ~]# docker images
 
  [root@sme9 ~]# docker images
 
  REPOSITORY                TAG                IMAGE ID            CREATED            VIRTUAL SIZE
 
  REPOSITORY                TAG                IMAGE ID            CREATED            VIRTUAL SIZE
 
  sme9                      6.5                55db4355a2de        46 minutes ago      854.7 MB
 
  sme9                      6.5                55db4355a2de        46 minutes ago      854.7 MB
 
  leszekk/centos_minimalcd  6.5                bc56fa8f1204        8 months ago        452.6 MB
 
  leszekk/centos_minimalcd  6.5                bc56fa8f1204        8 months ago        452.6 MB
 +
 
To create a copy of our sme9 image and save it as 'copyofsme9 you need to enter the following command:
 
To create a copy of our sme9 image and save it as 'copyofsme9 you need to enter the following command:
 
  docker save sme9:6.5 > /tmp/copyofsme9.tar
 
  docker save sme9:6.5 > /tmp/copyofsme9.tar
 +
 
which will result in a copyofsme9.tar file in your /tmp directory of your local server. You can now copy/move this file to another server or simply archive it for later usage.
 
which will result in a copyofsme9.tar file in your /tmp directory of your local server. You can now copy/move this file to another server or simply archive it for later usage.
    
To use the copyofsme9.tar file on another server and use it on that server with Docker, we can load it into the repository of the new server:
 
To use the copyofsme9.tar file on another server and use it on that server with Docker, we can load it into the repository of the new server:
 
  docker load -i < /downloads/copyofsme9.tar
 
  docker load -i < /downloads/copyofsme9.tar
 +
 
After Docker has loaded the file, you can check it's availability by executing: docker images and you can use it just like any other image on your new server. You can use the ''save'' and ''load'' commands to clean up your local repository and share copies of your image.
 
After Docker has loaded the file, you can check it's availability by executing: docker images and you can use it just like any other image on your new server. You can use the ''save'' and ''load'' commands to clean up your local repository and share copies of your image.
   Line 253: Line 348:  
===Docker Name resolution===
 
===Docker Name resolution===
   −
Normally you could add the DNS directly in the file /etc/sysconfig/docker, if you don't do that, your docker container could ping an IP, but never do the domain name translation. This is the dns of opendns, but you could change them.
+
 +
Other DNS can be added to the unit file or daemon.json - see further below for details.
 +
 
 +
Or you could add directly from the command line
 +
docker run -i -t -dns 208.67.220.220 -dns 208.67.220.222  sme9_real:6.5 /bin/bash
 +
 
 +
===Docker Compose===
 +
 
 +
https://github.com/docker/compose/releases/tag/1.29.2
 +
 
 +
curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
 +
chmod +x /usr/local/bin/docker-compose
 +
 
 +
===Shipyard web GUI===
 +
Deprecated
 +
There is a separate page on how to install Shipyard, the Docker web GUI [http://wiki.contribs.org/Shipyard here]
 +
 
 +
 
 +
===Issues===
 +
 
 +
This was a v9 issue. Leaving for reference.
 +
 
 +
You will find that if you use 'host' networking docker will set /sys as Read Only and you will get an error with the raid_check as per this bug
 +
 
 +
https://bugs.contribs.org/show_bug.cgi?id=10660
 +
 
 +
If you don't use host networking, you use the internal IP address set with docker, but this address is unknown as a local network to SME and it will block any queries emanating from the container. I am looking at this with the contrib.
 +
 
 +
 
 +
===Repo setup===
 +
 
 +
db yum_repositories set docker-ce-stable repository \
 +
    BaseURL 'https://download.docker.com/linux/centos/7/$basearch/stable' \
 +
    EnableGroups no \
 +
    GPGCheck yes \
 +
    GPGKey https://download.docker.com/linux/centos/gpg \
 +
    Name 'Docker Stable' \
 +
    Visible yes \
 +
    status enabled
 +
 
 +
signal-event yum-modify
 +
 
 +
yum --enablerepo=extras,docker-ce-stable install docker-ce docker-ce-cli
 +
 
 +
or to try with the smeserver-docker contrib - still modifying this
 +
 
 +
yum --enablerepo=extras,smetest install smeserver-docker
 +
 
 +
 
 +
So we get a service in /etc/systemd/system-preset/49-koozali.preset
 +
 
 +
config set docker service status enabled
 +
config set containerd service status enabled
 +
mkdir -p /home/e-smith/files/docker
 +
mkdir -p /home/e-smith/files/docker/configs
 +
 
 +
 
 +
Startup options
 +
 
 +
The big issue is getting this to work correctly with the firewall.
 +
 
 +
https://docs.docker.com/compose/compose-file/compose-file-v3
 +
 
 +
Host mode where the container has the same IP as the server and the service runs the same as any other host service, and can talk to other local host services easily, but exposes the container more.
 +
 
 +
Bridge mode where the container is on it's own internal docker network that is bridged to the local machine, but then queries emanating from the container will have the internal docker IP and can be refused by real 'local' services eg AD/MySQL etc. unless the firewall or other services can be adjusted.
 +
 
 +
 
 +
https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
 +
 
 +
network_mode: "bridge"
 +
network_mode: "host"
 +
network_mode: "none"
 +
network_mode: "service:[service name]"
 +
network_mode: "container:[container name/id]"
 +
 
 +
 
 +
https://docs.docker.com/compose/compose-file/compose-file-v3/#ports
 +
 
 +
Port mapping is incompatible with network_mode: host
 +
 
 +
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
 +
 
 +
We can add startup options via /etc/docker/daemon.json
 +
 
 +
===Files to modify?===
 +
 
 +
For now I have created a hardcoded file with the content from below
 +
 
 +
mkdir -p /usr/lib/systemd/system/docker.service.d
 +
 
 +
/usr/lib/systemd/system/docker.service.d/50koozali.conf
   −
# cat /etc/sysconfig/docker
+
If we template then we would use two fragments like this:
   −
  # /etc/sysconfig/docker
+
  /etc/e-smith/templates/usr/lib/systemd/system/docker.service.d/50koozali.conf/40service
#
  −
# Other arguments to pass to the docker daemon process
  −
# These will be parsed by the sysv initscript and appended
  −
# to the arguments list passed to docker -d
  −
  −
other_args="--dns 208.67.220.220 --dns 208.67.220.222"
     −
or you could add directly from the command line
+
[Service]
  docker run -i -t -dns 208.67.220.220 -dns 208.67.220.222 sme9_real:6.5 /bin/bash
+
Type=notify
 +
# the default is not to use systemd for cgroups because the delegate issues still
 +
  # exists and systemd currently does not support the cgroup feature set required
 +
# for containers run by docker
 +
# docker home set to /home/e-smith/files/docker
 +
ExecStart=
 +
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -g /home/e-smith/files/docker/data
 +
  ExecReload=/bin/kill -s HUP $MAINPID
 +
TimeoutSec=0
 +
RestartSec=2
 +
Restart=always
   −
==Challenges==
+
/etc/e-smith/templates/usr/lib/systemd/system/docker.service.d/50koozali.conf/80install
* How to interact with localhost PAM or LDAP from within a container?
     −
I think that you can access localhost services by adding:
+
[Install]
 +
WantedBy=sme-server.target
   −
  --net="host" to docker run
+
  expand-template /usr/lib/systemd/system/docker.service.d/50koozali.conf
   −
This means any services on the docker container are equally valid 'localhost' services accessible from the server itself so you need to ensure the server is properly firewalled. See Issues below.
     −
* Many more...
+
But now we can use /etc/docker/daemon.json
    +
This can be templated. Key point to avoid is a conflict between the docker internal network and out own.
 +
We also want to know what is happening with IPTables rules
   −
==Building your own images==
+
eg
* Notes
  −
Manual, or..
  −
https://github.com/docker/fig
     −
==='Proposal test image:'===
+
{
An application that requires Java, PHP, Apache, MySQL and LDAP. The localhost MySQL and localhost LDAP should be used by the application. The application should be publicly available either on a subdomain or specific port on the FQDN. The application should only be available between 08:00AM until 19:00PM.
+
  "bip": "192.168.100.1/24", << Set our own choice of internal network
All application data should be incorporated by the default SME Sever backup mechanisms, including the image itself.
+
  "data-root": "/home/e-smith/files/docker/data", << set our own data directory
 +
  "dns": ["127.0.0.1", "192.168.10.212"] << set our own DNS
 +
}
   −
* Building the image based on centos6
+
===Docker Networking===
* Configure networking, bridges and ports
  −
* Start/restart and stop syntax of the application
  −
* Configure cron
      +
Docker now does it's own thing with IPTables and it is hard to disable - we need to be careful here
   −
==Setting up a (Private) Docker repository==
+
https://docs.docker.com/network/iptables/
TBA
     −
* https://blog.codecentric.de/en/2014/02/docker-registry-run-private-docker-image-repository/
+
How do we check conflicts?
    +
ip addr show docker0
   −
===Docker notes===
+
  docker network ls
Loose notes:
  −
  docker=service
  −
access=public
  −
status=enabled
     −
==Docker Compose==
+
docker network inspect bridge
   −
The binary is included in the smeserver-docker contrib.
+
https://www.baeldung.com/ops/docker-network-information
   −
The latest version that you can use with the installed version of docker (currently 1.7.1) is docker-compose version 1.5.2
+
docker network inspect -f '{{range .IPAM.Config}}{{.Subnet}}{{end}}' bridge
https://github.com/docker/compose/releases/tag/1.5.2
+
172.17.0.0/16
   −
curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
+
So one way is to add it to the daemon.json file (see above)
chmod +x /usr/local/bin/docker-compose
     −
==Shipyard web GUI==
+
{
There is a separate page on how to install Shipyard, the Docker web GUI [http://wiki.contribs.org/Shipyard here]
+
"iptables": false
 +
}
    +
And note:
   −
==Related articles of interest==
+
Restart the Docker daemon and voila: your containers will not be exposed to every possible interface but you will need to explicitly manipulate your iptables rules if you want the traffic to pass through, e.g.: this is needed to NAT your containers:
* [http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/ Container storage and (re)size]
        −
==Things to do==
+
-A POSTROUTING -s 172.17.0.0/24 -o eth0 -j MASQUERADE
* Get the [https://github.com/shipyard/shipyard shipyard GUI] going
  −
* A LOT more ;-)
     −
==Issues==
+
An alternative which I use on RocketChat is to proxy calls using mod_proxy_tunnel.so
   −
You will find that if you use 'host' networking docker will set /sys as Read Only and you will get an error with the raid_check as per this bug
+
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/20LoadModule98ExtraMod
   −
https://bugs.contribs.org/show_bug.cgi?id=10660
+
{
 +
# Load wstunnel if available
 +
    if ( -e '/usr/lib64/httpd/modules/mod_proxy_wstunnel.so' ||
 +
        -e '/usr/lib/httpd/modules/mod_proxy_wstunnel.so') {
 +
            $OUT .= "LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so\n";
 +
    }
 +
}
   −
If you don't use host networking, you use the internal IP address set with docker, but this address is unknown as a local network to SME and it will block any queries emanating from the container. I am looking at this with the contrib.
+
You can then use some custom httpd templates to create a proxy pass virtual host.
   −
==Koozai SME v10==
+
===Docker Compose===
   −
Some basic scratchpad notes as I go
+
https://docs.docker.com/compose/install/
   −
https://docs.docker.com/engine/install/centos/
+
Check the latest release:
   −
Don't use the extras repo to install
+
https://github.com/docker/compose/releases/
   −
https://download.docker.com/linux/centos/docker-ce.repo
+
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 +
chmod 0700 /usr/local/bin/docker-compose
 +
chgrp docker /usr/local/bin/docker-compose
   −
===Repo setup===
+
Add template fragments here to make your compose file:
   −
  db yum_repositories set docker-ce-stable repository \
+
  /etc/e-smith/templates/home/e-smith/files/docker/configs/docker-compose.yml
    BaseURL 'https://download.docker.com/linux/centos/7/$basearch/stable' \
  −
    EnableGroups no \
  −
    GPGCheck yes \
  −
    GPGKey https://download.docker.com/linux/centos/gpg \
  −
    Name 'Docker Stable' \
  −
    Visible yes \
  −
    status disabled
     −
signal-event yum-modify
+
Note that there is now Compose format.
   −
yum install docker-ce docker-ce-cli containerd.io
+
https://github.com/docker/compose#where-to-get-docker-compose
   −
===Files to modify?===
+
https://github.com/docker/compose-switch
   −
systemd unit file
+
=== Old Unit file ===
 +
Previous unit file for ref
    
  [Unit]
 
  [Unit]
Line 415: Line 599:        +
==Bugs==
 +
 +
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}and select the smeserver-docker component or use
 +
{{BugzillaFileBug|product=SME%20Contribs|component=smeserver-docker |title=this link}}.
      −
[[Category:Containers]]
+
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |disablecache=1 |component=smeserver-docker |noresultsmessage="No open bugs found."}}
[[Category:Containers:Docker]]
+
 
 +
 
 +
==Changelog==
 +
 
 +
Only released version in smecontrib are listed here.
 +
 
 +
{{ #smechangelog: smeserver-docker }}
 +
 
 +
 
 +
 +
[[Category:Containers]]
 +
[[Category:Contrib]]
 +
[[Category:Containers:Docker]]

Navigation menu