How to Install Docker on Ubuntu 14.04 LTS

Introduction

Docker is a container-based software framework for automating deployment of applications. “Containers” are encapsulated, lightweight, and portable application modules.

Pre-Flight Check

  • These instructions are intended for installing Docker.
  • I’ll be working from a Liquid Web Core Managed Ubuntu 14.04 LTS server, and I’ll be logged in as root.

Step 1: Installation of Docker

First, you’ll follow a simple best practice: ensuring the list of available packages is up to date before installing anything new.

apt-get update

Let’s install Docker by installing the docker-io package:

apt-get -y install docker.io

Link and fix paths with the following two commands:

ln -sf /usr/bin/docker.io /usr/local/bin/docker
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io

Finally, and optionally, let’s configure Docker to start when the server boots:

update-rc.d docker.io defaults

Step 2: Download a Docker Container

Let’s begin using Docker! Download the fedora Docker image:

docker pull ubuntu

Step 3: Run a Docker Container

Now, to setup a basic ubuntu container with a bash shell, we just run one command. docker run will run a command in a new container, -i attaches stdin and stdout, -t allocates a tty, and we’re using the standard ubuntu container.

docker run -i -t ubuntu /bin/bash

That’s it! You’re now using a bash shell inside of a ubuntu docker container.

To disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q.

There are many community containers already available, which can be found through a search. In the command below I am searching for the keyword debian:

docker search debian

Source: How to Install Docker on Ubuntu 14.04 LTS | Liquid Web Knowledge Base

How to Install Docker on Ubuntu 14.04 LTS was last modified: February 9th, 2019 by Jovan Stosic

Move existing WordPress site into Docker – Dots and Brackets: Code Blog

Imagine you have the following existing python2 application “hello.py” with the following content:

print "hello"

You have to do the following things to dockerize this application:

Create a folder where you’d like to store your Dockerfile in.

Create a file named “Dockerfile”

The Dockerfile consists of several parts which you have to define as described below:

Like a VM, an image has an operating system. In this example, I use ubuntu 16.04. Thus, the first part of the Dockerfile is:

FROM ubuntu:16.04

Imagine you have a fresh Ubuntu – VM, now you have to install some things to get your application working, right? This is done by the next part of the Dockerfile:

RUN     apt-get update && \ 
        apt-get upgrade -y && \
        apt-get install -y python

For Docker, you have to create a working directory now in the image. The commands that you want to execute later on to start your application will search for files (like in our case the python file) in this directory. Thus, the next part of the Dockerfile creates a directory and defines this as the working directory:

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

As a next step, you copy the content of the folder where the Dockerfile is stored in to the image. In our example, the hello.py file is copied to the directory we created in the step above.

COPY . /usr/src/app

Finally, the following line executes the command “python hello.py” in your image:

CMD [ "python", "hello.py" ]

The complete Dockerfile looks like this:

FROM ubuntu:16.04

RUN     apt-get update && \
        apt-get upgrade -y && \
        apt-get install -y python 

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app

CMD [ "python", "hello.py" ]

Save the file and build the image by typing in the terminal:

$ docker build -t hello .

This will take some time. Afterwards, check if the image “hello” how we called it in the last line has been built successfully:

$ docker images

Run the image:

docker run hello

The output shout be “hello” in the terminal.

This is a first start. When you use Docker for web applications, you have to configure ports etc.

https://codeblog.dotsandbrackets.com/migrate-wordpress-docker/

Move existing WordPress site into Docker – Dots and Brackets: Code Blog was last modified: February 10th, 2019 by Jovan Stosic

virtualbox – How to change UUID in virtual box

The following worked for me:

  1. run VBoxManage internalcommands sethduuid “VDI/VMDK file” twice (the first time is just to conveniently generate an UUID, you could use any other UUID generation method instead)
  2. open the .vbox file in a text editor
  3. replace the UUID found in Machine uuid=”{…}” with the UUID you got when you ran sethduuid the first time
  4. replace the UUID found in HardDisk uuid=”{…}” and in Image uuid=”{}” (towards the end) with the UUID you got when you ran sethduuid the second time

Source: virtualbox – How to change UUID in virtual box – Stack Overflow

virtualbox – How to change UUID in virtual box was last modified: February 3rd, 2019 by Jovan Stosic

terminal + ssh doesn’t display UTF correctly – Ask Ubuntu

I have a remote server, to which I connect via SSH.

On separate Mac OS and Gentoo computers, when I connect to this server, unicode works fine. On my brand new Ubuntu installation, I don’t see unicode on this server correctly and I can’t seem to insert them correctly either.

I have a file with a letter “ž”. When I less it locally, on Ubuntu, in Terminal, I see correct “ž”. When I less the same file on the aforementioned server via SSH, I see just – both in Terminal and xterm.

locale on the server shows me this

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=cs_CZ.UTF-8
LC_TIME=cs_CZ.UTF-8
LC_COLLATE=”en_US.UTF-8″
LC_MONETARY=cs_CZ.UTF-8
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=cs_CZ.UTF-8
LC_NAME=cs_CZ.UTF-8
LC_ADDRESS=cs_CZ.UTF-8
LC_TELEPHONE=cs_CZ.UTF-8
LC_MEASUREMENT=cs_CZ.UTF-8
LC_IDENTIFICATION=cs_CZ.UTF-8
LC_ALL=

Terminal has UTF8 encoding (and as I wrote, the unicode file is opened correctly when opened locally).

What can be wrong?
ssh gnome-terminal unicode
shareimprove this question
asked Feb 17 ’14 at 0:28
Karel Bílek
79431023
add a comment
1 Answer
active
oldest
votes
9

This answer to a similar question helped

https://askubuntu.com/a/144448/9685

Commenting out SendEnv LANG LC_* in the local /etc/ssh/ssh_config file fixed everything.
shareimprove this answer
edited Apr 13 ’17 at 12:25
Community♦
1
answered Feb 17 ’14 at 0:37
Karel Bílek
79431023

add a comment
 

Source: terminal + ssh doesn’t display UTF correctly – Ask Ubuntu

terminal + ssh doesn’t display UTF correctly – Ask Ubuntu was last modified: February 2nd, 2019 by Jovan Stosic

ssh through second network card using PUTTY – Google Groups

Hi,I am using Putty and want to open a ssh using a second network card,

I can find no settings whereby the second card can be selected.

I have the following settings
Running Win7
Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix  . :
IP Address. . . . . . . . . . . . : 192.168.1.170
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix  . :
IP Address. . . . . . . . . . . . : 10.0.0.5
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . : 10.0.0.1

Is there something that I am missing.

Another option would be to use telnet session, but I can also find no way of
forcing the telnet to go through the second card.

Thanks in advance

——————————————————————————

    AFAIK there is no way  in putty you can select  an  interface before opening
a SSH connection. One way to do this is to change the network interface “metric”
value. Just increase the “interface 1” metric value and W2K will start using the
interface 2 for all the network activity.

To change the metric do the following

Right click on the “My Network Places” -> right click on  the “Local Area
Connection” -> select properties ->select Internet Protocol (TCP/IP) ->select
properties-> click on advanced and change value of interface metric to “2”.
Click on “OK” .

Now putty (in fact all the apps) should start using the second interface for all the new connections.

Source: ssh through second network card using PUTTY – Google Groups

ssh through second network card using PUTTY – Google Groups was last modified: January 25th, 2019 by Jovan Stosic

Squid – Proxy Server

Squid is a full-featured web proxy cache server application which provides proxy and cache services for Hyper Text Transport Protocol (HTTP), File Transfer Protocol (FTP), and other popular network protocols. Squid can implement caching and proxying of Secure Sockets Layer (SSL) requests and caching of Domain Name Server (DNS) lookups, and perform transparent caching. Squid also supports a wide variety of caching protocols, such as Internet Cache Protocol (ICP), the Hyper Text Caching Protocol (HTCP), the Cache Array Routing Protocol (CARP), and the Web Cache Coordination Protocol (WCCP).

The Squid proxy cache server is an excellent solution to a variety of proxy and caching server needs, and scales from the branch office to enterprise level networks while providing extensive, granular access control mechanisms, and monitoring of critical parameters via the Simple Network Management Protocol (SNMP). When selecting a computer system for use as a dedicated Squid caching proxy server for many users ensure it is configured with a large amount of physical memory as Squid maintains an in-memory cache for increased performance.

Installation
Configuration
References

Installation

At a terminal prompt, enter the following command to install the Squid server:

sudo apt install squid

Configuration

Squid is configured by editing the directives contained within the /etc/squid/squid.conf configuration file. The following examples illustrate some of the directives which may be modified to affect the behavior of the Squid server. For more in-depth configuration of Squid, see the References section.

Prior to editing the configuration file, you should make a copy of the original file and protect it from writing so you will have the original settings as a reference, and to re-use as necessary. Make this copy and protect it from writing using the following commands:

sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original
sudo chmod a-w /etc/squid/squid.conf.original

To set your Squid server to listen on TCP port 8888 instead of the default TCP port 3128, change the http_port directive as such:

http_port 8888

Change the visible_hostname directive in order to give the Squid server a specific hostname. This hostname does not necessarily need to be the computer’s hostname. In this example it is set to weezie

visible_hostname weezie

Using Squid’s access control, you may configure use of Internet services proxied by Squid to be available only users with certain Internet Protocol (IP) addresses. For example, we will illustrate access by users of the 192.168.42.0/24 subnetwork only:

Add the following to the bottom of the ACL section of your /etc/squid/squid.conf file:

acl fortytwo_network src 192.168.42.0/24

Then, add the following to the top of the http_access section of your /etc/squid/squid.conf file:

http_access allow fortytwo_network

Using the excellent access control features of Squid, you may configure use of Internet services proxied by Squid to be available only during normal business hours. For example, we’ll illustrate access by employees of a business which is operating between 9:00AM and 5:00PM, Monday through Friday, and which uses the 10.1.42.0/24 subnetwork:

Add the following to the bottom of the ACL section of your /etc/squid/squid.conf file:

acl biz_network src 10.1.42.0/24
acl biz_hours time M T W T F 9:00-17:00

Then, add the following to the top of the http_access section of your /etc/squid/squid.conf file:

http_access allow biz_network biz_hours

After making changes to the /etc/squid/squid.conf file, save the file and restart the squid server application to effect the changes using the following command entered at a terminal prompt:

sudo systemctl restart squid.service

If formerly a customized squid3 was used that set up the spool at /var/log/squid3 to be a mountpoint, but otherwise kept the default configuration the upgrade will fail. The upgrade tries to rename/move files as needed, but it can’t do so for an active mountpoint. In that case please either adapt the mountpoint or the config in /etc/squid/squid.conf so that they match.

The same applies if the include config statement was used to pull in more files from the old path at /etc/squid3/. In those cases you should move and adapt your configuration accordingly.

Squid – Proxy Server was last modified: January 22nd, 2019 by Jovan Stosic