Home Blog Page 427

How to Install Docker CE on Your Desktop

In the previous article, we learned some of the basic terminologies of the container world. That background information will come in handy when we run commands and use some of those terms in follow-up articles, including this one. This article will cover the installation of Docker on desktop Linux, macOS, and Windows, and it is intended for beginners who want to get started with Docker containers. The only prerequisite is that you are comfortable with command-line interface.

Why do I need Docker CE on my local machine?

As a new user, you many wonder why you need containers on your local systems. Aren’t they meant to run in cloud and servers as microservices? While containers have been part of the Linux world for a very long time, it was Docker that made them really consumable with its tools and technologies.

The greatest thing about Docker containers is that you can use your local machine for development and testing. The container images that you create on your local system can then run “anywhere.” There is no conflict between developers and operators about apps running fine on development systems but not in production.

The point is that in order to create containerized applications, you must be able to run and create containers on your local systems.

You can use any of the three platforms — desktop Linux, Windows, or macOS as the development platform for containers. Once Docker is successfully running on these systems, you will be using the same commands across platforms so it really doesn’t matter which OS you are running underneath.

That’s the beauty of Docker.

Let’s get started

There are two editions of Docker. Docker Enterprise Edition (EE) and Docker Community Edition (CE). We will be using the Docker Community Edition, which is a free of cost version of Docker intended for developers and enthusiasts who want to get started with Docker.

There are two channels of Docker CE: stable and edge. As the name implies, the stable version gives you well-tested quarterly updates, whereas the edge version offers new updates every month. After further testing, these edge features are added to the stable release. I recommend the stable version for new users.

Docker CE is supported on macOS, Windows 10, Ubuntu 14.04, 16.04, 17.04 and 17.10; Debian 7.7,8,9 and 10; Fedora 25, 26, 27; and centOS. While you can download Docker CE binaries and install on your Desktop Linux systems, I recommend adding repositories so you continue to receive patches and updates.

Install Docker CE on Desktop Linux

You don’t need a full blown desktop Linux to run Docker, you can install it on a bare minimal Linux server as well, that you can run in a VM. In this tutorial, I am running it on Fedora 27 and Ubuntu 17.04 running on my main systems.

Ubuntu Installation

First things first. Run a system update so your Ubuntu packages are fully updated:

$ sudo apt-get update

Now run system upgrade:

$ sudo apt-get dist-upgrade

Then install Docker PGP keys:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the repository info again:
$ sudo apt-get update

Now install Docker CE:

$ sudo apt-get install docker-ce

Once it’s installed, Docker CE runs automatically on Ubuntu based systems. Let’s check if it’s running:

$ sudo systemctl status docker

You should get the following output:

docker.service - Docker Application Container Engine
  Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Active: active (running) since Thu 2017-12-28 15:06:35 EST; 19min ago
    Docs: https://docs.docker.com
Main PID: 30539 (dockerd)

Since Docker is installed on your system, you can now use Docker CLI (Command Line Interface) to run Docker commands. Living up to the tradition, let’s run the ‘Hello World’ command:

$ sudo docker run hello-world

YMChR_7xglpYBT91rtXnqQc6R1Hx9qMX_iO99vL8

Congrats! You have Docker running on your Ubuntu system.  

Installing Docker CE on Fedora

Things are a bit different on Fedora 27. On Fedora, you first need to install def-plugins-core packages that will allow you to manage your DNF packages from CLI.

$ sudo dnf -y install dnf-plugins-core

Now install the Docker repo on your system:

$ sudo dnf config-manager 
    --add-repo 
    https://download.docker.com/linux/fedora/docker-ce.repo
It’s time to install Docker CE:
$ sudo dnf install docker-ce

Unlike Ubuntu, Docker doesn’t start automatically on Fedora. So let’s start it:

$ sudo systemctl start docker

You will have to start Docker manually after each reboot, so let’s configure it to start automatically after reboots. $ systemctl enable docker Well, it’s time to run the Hello World command:

$ sudo docker run hello-world

Congrats, Docker is running on your Fedora 27 system.

Cutting your roots

You may have noticed that you have to use sudo to run Docker commands. That’s because of Docker daemon’s binding with the UNIX socket, instead of a TCP port and that socket is owned by the root user. So, you need sudo privileges to run the docker command. You can add system user to the docker group so it won’t require sudo:

$ sudo groupadd docker

In most cases, the docker user group is automatically created when you install Docker CE, so all you need to do is add your user to that group:

$ sudo usermod -aG docker $USER

To test if the group has been added successfully, run the groups command against the name of the user:

$ groups swapnil

(Here, Swapnil is the user.)

This is the output on my system:

$ swapnil : swapnil adm cdrom sudo dip plugdev lpadmin sambashare docker

You can see that the user also belongs to the docker group. Log out of your system, so that group changes take effect. Once you log back in, try the Hello World command without sudo:

$ docker run hello-world

You can check system wide info about the installed version of Docker and more by running this command:

$ docker info

Install Docker CE on macOS and Windows

You can easily install Docker CE (and EE) on macOS and Windows. Download the official Docker for Mac and install it the way you install applications on macOS, by simply dragging them into the Applications directory. Once the file is copied, open Docker from spotlight to start the installation process. Once installed, Docker will start automatically and you can see it in the top bar of macOS.

IEX23j65zYlF8mZ1c-T_vFw_i1B1T1hibw_AuhEA

macOS is UNIX, so you can simply open the terminal app and start using Docker commands natively. Test the hello world app:

$ docker run hello-world

Congrats, you have Docker running on your macOS.

Docker on Windows 10

You need the latest version of Windows 10 Pro or Server in order to run/install Docker on it. If you are not fully updated, Windows won’t install Docker. I got an error on my Windows 10 system and had to run system updates. My version was still behind, and I hit this bug. So, if you fail to install Docker on Windows, just know you are not alone. Keep an eye on that bug to find a solution.

Once you install Docker on Windows, you can either use bash shell via WSL or use PowerShell to run docker commands. Let’s test the “Hello World” command in PowerShell:

PS C:Usersswapnil> docker run hello-world

Congrats, you have Docker running on Windows.

In the next article, we will talk about pulling images from DockerHub and running containers on our systems. We will also talk about pushing our own containers to Docker Hub.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

What You Need to Know About the Meltdown and Spectre CPU Flaws

The computer industry is racing to deal with several new vulnerabilities that affect the majority of processors in modern computers and mobile devices. The flaws enable new attacks that break the critical memory defenses in operating systems and bypass fundamental isolation layers, including those vital to virtualization and container technologies.

The most serious of the flaws, dubbed Meltdown or CVE-2017-5754, allows applications running in userspace to extract information from the kernel’s memory, which can contain sensitive data like passwords, encryption keys and other secrets. The good news is that Meltdown can be largely mitigated through software patches, unlike two other vulnerabilities known collectively as Spectre (CVE-2017-5753 and CVE-2017-5715) that will require CPU microcode updates and will likely haunt the industry for some time to come.

Both Meltdown and Spectre stem from a performance-related feature of modern CPUs called speculative execution.

Read more at The New Stack

You GNOME it: Windows and Apple Devs Get a Compelling Reason to Turn to Linux

The biggest open source story of 2017 was unquestionably Canonical’s decision to stop developing its Unity desktop and move Ubuntu to the GNOME Shell desktop.

What made the story that much more entertaining was how well Canonical pulled off the transition. Ubuntu 17.10 was quite simply one of the best releases of the year and certainly the best release Ubuntu has put out in a good long time. Of course since 17.10 was not an LTS release, the more conservative users – which may well be the majority in Ubuntu’s case – still haven’t made the transition.

Meanwhile, the repercussions of Canonical’s move to GNOME are still being felt in the open source world and I believe this will continue to be one of the biggest stories in 2018 for several reasons. The first is that so many have yet to actually make the move to GNOME-based Ubuntu. That will change with 18.04, which is an LTS release set to arrive later this year. Users upgrading between LTS releases will get their first taste of Ubuntu with GNOME come April.

Read more at The Register

Rethinking Your Open Source Use Policy

We don’t code the same way we used to.

I spoke with someone the other day that was fired from his job as a technical product manager after more than 20 years of experience. He is now job-searching but is finding it difficult. There is a new bar set for speed of technology development that capitalizes on agile software development practices and leveraging open source technologies—two things that were not taken seriously just ten years ago. According to 69 percent of senior executives, this digital transformation is forcing us now to rethink our cybersecurity strategies.

To accommodate these time constraints from management, developers have turned more and more to open source code as a great asset to build products and features, as opposed to writing code from scratch.  Open source technologies are available openly on the internet through sites like GitHub and SourceForge. Open source code now makes up 90 percent of the code composition of our modern applications.

Read more at InfoWorld

What Is Machine Learning?

Machine learning is one of the hottest trends in technology today. In fact, Gartner put machine learning at the peak of its most recent Hype Cycle for Emerging Technology. And the firm has predicted that by 2020, artificial intelligence (AI)technologies, including machine learning “will be virtually pervasive in almost every new software product and service.”

According to IDC, organizations will spend $12.5 billion on AI systems in 2017. That’s a huge 59.3 percent increase over 2016 levels, and the analysts say that spending will continue to grow at more than 50 percent per year through 2020. At that point, total AI revenue could top $46 million. David Schubmehl, research director, cognitive systems and content analytics at IDC, said, “Cognitive/AI systems are quickly becoming a key part of IT infrastructure and all enterprises need to understand and plan for the adoption and use of these technologies in their organizations.”

So what is machine learning? What is its relationship to artificial intelligence? And what should technology professionals know about its potential benefits and challenges?

Read more at Datamation

Linux Kernel 4.15 to Arrive in Two Weeks as Linus Torvalds Releases Seventh RC

Linux kernel 4.15 has been in development since the end of November 2017, and it’s now time the development cycle to come to an end, and today’s Release Candidate brings even more of the x86 page table isolation (PTI) patches to mitigate those nasty Meltdown and Spectre security vulnerabilities that put billions of devices at risk of attacks.

“Ok, we had an interesting week, and by now everybody knows why we were merging all those odd x86 page table isolation patches without following all of the normal release timing rules,” said Linus Torvalds in the mailing list announcement. “Anyway, due to this all, 4.15 will obviously be one of the releases with an rc8, even if things are starting to really calm down by now.”

Read more at Softpedia

The Best Linux Distributions for 2018

It’s a new year and the landscape of possibility is limitless for Linux. Whereas 2017 brought about some big changes to a number of Linux distributions, I believe 2018 will bring serious stability and market share growth—for both the server and the desktop.

For those who might be looking to migrate to the open source platform (or those looking to switch it up), what are the best choices for the coming year? If you hop over to Distrowatch, you’ll find a dizzying array of possibilities, some of which are on the rise, and some that are seeing quite the opposite effect.

So, which Linux distributions will 2018 favor? I have my thoughts. In fact, I’m going to share them with you now.

Similar to what I did for last year’s list, I’m going to make this task easier and break down the list, as follows: sysadmin, lightweight distribution, desktop, distro with more to prove, IoT, and server. These categories should cover the needs of any type of Linux user.

With that said, let’s get to the list of best Linux distributions for 2018.

Best distribution for sysadmins

Debian isn’t often seen on “best of” lists. It should be. Why? If you consider that Debian is the foundation for Ubuntu (which is, in turn, the foundation for so many distributions), it’s pretty easy to understand why this distribution should find its way on many a list. But why for administrators? I’ve considered this for two very important reasons:

  • Ease of use

  • Extreme stability

Because Debian uses the dpkg and apt package managers, it makes for an incredibly easy to use environment. And because Debian offers one of the the most stable Linux platforms, it makes for an ideal environment for so many things: Desktops, servers, testing, development. Although Debian may not include the plethora of applications found in last years winner (for this category), Parrot Linux, it is very easy to add any/all the necessary applications you need to get the job done. And because Debian can be installed with your choice of desktop (Cinnamon, GNOME, KDE, LXDE, Mate, or Xfce), you can be sure the interface will meet your needs.

Figure 1: The GNOME desktop running on top of Debian 9.3.

At the moment, Debian is listed at #2 on Distrowatch. Download it, install it, and then make it serve a specific purpose. It may not be flashy, but Debian is a sysadmin dream come true.

Best lightweight distribution

Lightweight distribution serve a very specific purpose—giving new life to older, lesser-powered machines. But that doesn’t mean these particular distributions should only be considered for your older hardware. If speed is your ultimate need, you might want to see just how fast this category of distribution will run on your modern machine.

Topping the list of lightweight distributions for 2018 is Lubuntu. Although there are plenty of options in this category, few come even close to the next-to-zero learning curve found on this distribution. And although Lubuntu’s footprint isn’t quite as small as Puppy Linux, thanks to it being a member of the Ubuntu family, the ease of use gained with this distribution makes up for it. But fear not, Lubuntu won’t bog down your older hardware.The requirements are:

  • CPU: Pentium 4 or Pentium M or AMD K8

  • For local applications, Lubuntu can function with 512MB of RAM. For online usage (Youtube, Google+, Google Drive, and Facebook),  1GB of RAM is recommended.

Lubuntu makes use of the LXDE desktop (Figure 2), which means users new to Linux won’t have the slightest problem working with this distribution. The short list of included apps (such as Abiword, Gnumeric, and Firefox) are all lightning fast and user-friendly.

Figure 2: The Lubuntu LXDE desktop in action.

Lubntu can make short and easy work of breathing life into hardware that is up to ten years old.

Best desktop distribution

For the second year in a row, Elementary OS tops my list of best Desktop distribution. For many, the leader on the Desktop is Linux Mint (which is a very fine flavor). However, for my money, it’s hard to beat the ease of use and stability of Elementary OS. Case in point, I was certain the release of Ubuntu 17.10 would have me migrating back to Canonical’s distribution. Very soon after migrating to the new GNOME-Friendly Ubuntu, I found myself missing the look, feel, and reliability of Elementary OS (Figure 3). After two weeks with Ubuntu, I was back to Elementary OS.

Figure 3: The Pantheon desktop is a work of art as a desktop.

Anyone that has given Elementary OS a go immediately feels right at home. The Pantheon desktop is a perfect combination of slickness and user-friendliness. And with each update, it only gets better.

Although Elementary OS stands at #6 on the Distrowatch page hit ranking, I predict it will find itself climbing to at least the third spot by the end of 2018. The Elementary developers are very much in tune with what users want. They listen and they evolve. However, the current state of this distribution is so good, it seems all they could do to better it is a bit of polish here and there. Anyone looking for a desktop that offers a unified look and feel throughout the UI, Elementary OS is hard to beat. If you need a desktop that offers an outstanding ratio of reliability and ease of use, Elementary OS is your distribution.

Best distro for those with something to prove

For the longest time Gentoo sat on top of the “show us your skills” distribution list. However, I think it’s time Gentoo took a backseat to the true leader of “something to prove”: Linux From Scratch. You may not think this fair, as LFS isn’t actually a distribution, but a project that helps users create their own Linux distribution. But, seriously, if you want to go a very long way to proving your Linux knowledge, what better way than to create your own distribution? From the LFS project, you can build a custom Linux system, from the ground up… entirely from source code. So, if you really have something to prove, download the Linux From Scratch Book and start building.

Best distribution for IoT

For the second year in a row Ubuntu Core wins, hands down. Ubuntu Core is a tiny, transactional version of Ubuntu, built specifically for embedded and IoT devices. What makes Ubuntu Core so perfect for IoT is that it places the focus on snap packages—universal packages that can be installed onto a platform, without interfering with the base system. These snap packages contain everything they need to run (including dependencies), so there is no worry the installation will break the operating system (or any other installed software). Also, snaps are very easy to upgrade and run in an isolated sandbox, making them a great solution for IoT.

Another area of security built into Ubuntu Core is the login mechanism. Ubuntu Core works with Ubuntu One ssh keys, such that the only way to log into the system is via uploaded ssh keys to a Ubuntu One account (Figure 4). This makes for a heightened security for your IoT devices.

Figure 4:The Ubuntu Core screen indicating a remote access enabled via Ubuntu One user.

Best server distribution

This where things get a bit confusing. The primary reason is support. If you need commercial support your best choice might be, at first blush, Red Hat Enterprise Linux. Red Hat has proved itself, year after year, to not only be one of the strongest enterprise server platforms on the planet, but the single most profitable open source businesses (with over $2 billion in annual revenue).

However, Red Hat isn’t far and away the only server distribution. In fact, Red Hat doesn’t even dominate every aspect of Enterprise server computing. If you look at cloud statistics on Amazon’s Elastic Compute Cloud alone, Ubuntu blows away Red Hat Enterprise Linux. According to The Cloud Market, EC2 statistics show RHEL at under 100k deployments, whereas Ubuntu is over 200k deployments. That’s significant.

The end result is that Ubuntu has pretty much taken over as the leader in the cloud. And if you combine that with Ubuntu’s ease of working with and managing containers, it starts to become clear that Ubuntu Server is the clear winner for the Server category. And, if you need commercial support, Canonical has you covered, with Ubuntu Advantage.

The one caveat to Ubuntu Server is that it defaults to a text-only interface (Figure 5). You can install a GUI, if needed, but working with the Ubuntu Server command line is pretty straightforward (and something every Linux administrator should know).

Figure 5: The Ubuntu server login, informing of updates.

The choice is yours

As I said before, these choices are all very subjective … but if you’re looking for a great place to start, give these distributions a try. Each one can serve a very specific purpose and do it better than most. Although you may not agree with my particular picks, chances are you’ll agree that Linux offers amazing possibilities on every front. And, stay tuned for more “best distro” picks next week.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

This Week in Open Source News: Snow Science Benefits From Open Source, Linus Torvalds Weighs in on Linux-Intel Fix & More

This week in Linux and open source news, let it snow! Open source software is improving snow science, Linus Torvalds answers questions about the fix for Intel’s security vulnerability, and more! Read on to stay in the know. 

1) “Snow science recently took an about-face, thanks to the open-source software [project] known as SnowPilot.”

Open Source Software Improves Snow Research– Explore Big Sky

2) Steven J. Vaughan-Nichols talks with Linus Torvalds about the Intel vulnerability fix.

Major Linux Redesign in the Works to Deal With Intel Security Flaw– ZDNet

3) “The cable industry is turning to OpenStack for the development of virtualized network functions, and it’s hoping to learn a lesson or two from earlier telco forays.”

Cable’s Open Source Flirtation Heats Up– LightReading

4) Amazon releases Linux software that runs on corporate servers.

Amazon Has Quietly Released a Game Changer For Its Cloud– Business Insider

5) “Toyota will showcase its Linux-based infotainment platform [at CES] that will be included in the 2018 Camry.”

CES Preview: Back to the Future– Automotive News

Intel Deploying Updates for Spectre and Meltdown Exploits

Intel reports that company has developed and is rapidly issuing updates for all types of Intel-based computer systems — including personal computers and servers — that render those systems immune from “Spectre” and “Meltdown” exploits reported by Google Project Zero. Intel and its partners have made significant progress in deploying updates as both software patches and firmware updates.

Intel continues to believe that the performance impact of these updates is highly workload-dependent and, for the average computer user, should not be significant and will be mitigated over time.

Read more at insideHPC

Enterprise Roles in Open Source Compliance

No individual, no matter how adept, can successfully implement open source compliance across an entire organization. Keeping track of where and how open source code is used, approved, and shipped must be a cross-functional team effort.

From core engineering and product teams, to legal counsel and upper management, compliance involves individuals in many roles from various departments throughout the company.

In this article, highlighting a chapter of The Linux Foundation ebook Open Source Compliance in the Enterprise by Ibrahim Haddad, we’ll give an overview of the roles and responsibilities that any open source compliance program should include. Together, these are the individuals who will make sure your company stays current and compliant with the open source licenses in the code you use and ship.

Read more at The Linux Foundation