Docker Installation

.

Follow these steps to install Docker. I have Fedora 23:

  • Add Docker  repo. I will use the baseurl for Fedora 22 because Fedora 23 is new and no Docker repo for it:

cat >/etc/yum.repos.d/docker.repo <<-EOF

[dockerrepo]

name=Docker Repository

baseurl=https://yum.dockerproject.org/repo/main/fedora/22

enabled=1

gpgcheck=1

gpgkey=https://yum.dockerproject.org/gpg

EOF

  • Use dnf to install Docker (yum is deprecated): # sudo dnf -y -q install docker-engine
  • Start the daemon: # sudo systemctl start docker-engine
  • Enable the daemon so it will start on boot: # sudo systemctl enable docker
  • By default, docker listens on a UNIX socket (more secure): “unix:///var/run/docker.sock”. This allows only local connections. To list the permissions of the docker socket file:

ls -l  /var/run/docker.sock
srw-rw—-. 1 root docker 0 Nov 19 09:36 /var/run/docker.sock

As we see this file is readable and writable by the user (root) and the group (docker). So to send command to docker daemon from the docker client, we need to be either root user (directly or as sudo user) or add your user to the group “docker” (NOT secure). To add a user to the group “docker”, execute: # sudo usermod -aG docker your_username

To allow remote connections from docker clients (NOT Secure), we can use the option “-H”. Open the unit file of the docker service “/usr/lib/systemd/system/docker.service” and update the line “ExecStart=/usr/bin/docker daemon -H fd://” using “-H host:port”. If you update the unit file you need to restart the docker.

  • Log out and in or even reboot the system.
  • Verify the installation: # docker run hello-world

 Output:

Hello from Docker.
This message shows that your installation appears to be working correctly.

…..


Advertisements

Syncing Your GitHub Fork

.

If you have forked a project on GitHub, you will have your own copy of the project in your GitHub account. Your copy will not be automatically synced with the original. Follow these simple steps to sync your repo with the original repo:

Assuming you have your fork on your local computer (local clone of the fork is created using git clone command). Add the remote upstream:

# git remote add upstream $originalRepoURL

Check the remote URL: # git remote -v

You will see the URLs of the fork and the original.

Now fetch the upstream: # git fetch upstream

Check out the local master branch of the fork: # git checkout master

Doing this you will be switched to the local master branch of the fork.

Merge the changes. Assuming you want to merge the local master branch of the fork with the master branch of the upstream: # git merge upstream/master
Push the changes to your GitHub copy: # git push origin master

Enter your credentials and check the update on GitHub.