Tag Archives: docker

How to mount NFS in a Docker Ubuntu container | mounting nfs shares in docker containers

I had problems mounting NFS shares in my docker container, error would appear with permissions denied. This is the fix which worked for me.

Inside the container execute the following.

on the host execute the following to mount the share.

 

How to setup Nextcloud 13 in a Docker container | how to setup nextcloud 13 on docker

I have written a script which will setup Nextcloud on a Ubuntu Docker container. Ill run through the entire process.

First we need to download the correct image into docker.

Then we need to start the container with the os.

Now we need to find the unique id of the container

Now on the host, so not the container.  Create the script.

Now paste the following into the script.

Now adjust the permissions to make it executable.

Now lets copy it over to the container

Then jump on the console.

Once your connected in, execute the script, this will install setup everything.

Once complete. Hit your web browser, navigate to https://localhost:10000/nextcloud. Should see the logon page, your credentials are Username: admin Password: password

 

Apache Load Balancer and reverse proxy howto | Apache2 load balancer reverse proxy howto

I wasted alot of time trying to figure out how to use Apache as a reverse proxy to load balance two of my web servers.

I thought I would write a little howto on how to get this up and running quickly.

I know used this setup with docker, using two containers running a standard installation of Apache and the other running Apache with the below configuration (Load Balancer)

Lets get started

The following commands will install all the required software using apt and aptitude.

Run the following to install all the required Apache modules.

Now we need up edit the following Apache configuration file.

This is what the configuration file should look like, please change the IPs and ports of the webservers your proxying.

Restart Apache and your ready to rock and roll!

 

Howto open ports into your Docker containers | docker ubuntu how to open ports in containters

I’m playing around with docker containers, I just wanted to build a docker container and run a service on it which will be accessible externally.

Lets start by getting a fresh ubuntu image from the repos.

Lets see what images are now available, you should see the latest download in the list.

You see this. We’ll pick the newest one.

Now this is how we select the image and open the ports, see the “-p” switches? This will open SSH (22) and Web (80).

This will build the container, once your at the logon prompt you will need to install the services, ie

This will update apt and install apache and ssh

This will start the services.

This will enable the services to start at startup.

Now the container is setup we can exit out.

Once we have exited we’ll start the container.

Now we need to find out if the container is running, and if its running which random ports its assigned to our services.

That command will display the following.

Now the above output tells us the container is running and it has assigned ports to out services. So if you put up the webbrowser on your computer and put the hosts IP in like this,

Now you should see the apache test page.

or is you want to ssh into the container enter this command

Just name sure you setup a user account on the container first.

Docker crash course with Ubuntu – for beginners | docker ubunter 16.04 beginners guide howto

A quick crash course on how to get a docker container up and going on a Ubuntu 16.04 server.

01. This first section will essentially install the docker repos onto the Ubuntu box.

02. This will actually install docker.

03. Check that its running.

04. This will test that docker is properly installed and able to execute docker containers.

05. This will download the ubuntu image from the repo.

06. The will need to list the images which are available to us, taking note of the image ID

07. Then we cut-n-paste the ID into the command below.

08. You will now notice your running a full blown Ubuntu OS which is actually in a container, this is tested by checking what procs are running by typing “ps waux”, there should only be a few procs running.

09. Exit out of the container, this will end the container

10. The following command will show you the available containers

11.  Determine which container you worked on, cut and paste the ID into the command below to start it in the background.

12. The container is now running, can may connect to it on the terminal by typing the following command and pasting the ID at the end.

 

All you need to know to get you going!