Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #206663 > unrolled thread

Recommended way to install Docker in Stretch

Started byLuís Gomes <luismsgomes@gmail.com>
First post2019-03-27 14:00 +0100
Last post2019-03-28 00:40 +0100
Articles 7 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  Recommended way to install Docker in Stretch Luís Gomes <luismsgomes@gmail.com> - 2019-03-27 14:00 +0100
    Re: Recommended way to install Docker in Stretch Sven Hartge <sven@svenhartge.de> - 2019-03-27 14:10 +0100
      Re: Recommended way to install Docker in Stretch Roberto C. Sánchez <roberto@debian.org> - 2019-03-27 14:50 +0100
        Re: Recommended way to install Docker in Stretch Sven Hartge <sven@svenhartge.de> - 2019-03-27 15:10 +0100
          Re: Recommended way to install Docker in Stretch Roberto C. Sánchez <roberto@debian.org> - 2019-03-27 15:20 +0100
    Re: Recommended way to install Docker in Stretch Paul Sutton <zleap@disroot.org> - 2019-03-27 15:00 +0100
      Re: Recommended way to install Docker in Stretch Linux-Fan <Ma_Sys.ma@web.de> - 2019-03-28 00:40 +0100

#206663 — Recommended way to install Docker in Stretch

FromLuís Gomes <luismsgomes@gmail.com>
Date2019-03-27 14:00 +0100
SubjectRecommended way to install Docker in Stretch
Message-ID<xGgjT-fj-1@gated-at.bofh.it>
Hello everyone,

I'm setting up a server with Debian Stretch and I need to install
Docker.

After reading the warning against installing software from unnoficial
repositories from https://wiki.debian.org/DontBreakDebian I'm trying to
follow this good advice.

However, I could not find a docker.io package on the main stretch
repository or in stretch-backports, which makes me ask what is the
Debian-recommended-way to install Docker on Stretch?


Thanks,

Luís

[toc] | [next] | [standalone]


#206664

FromSven Hartge <sven@svenhartge.de>
Date2019-03-27 14:10 +0100
Message-ID<xGgtA-xI-3@gated-at.bofh.it>
In reply to#206663
Luís Gomes <luismsgomes@gmail.com> wrote:

> However, I could not find a docker.io package on the main stretch
> repository or in stretch-backports, which makes me ask what is the
> Debian-recommended-way to install Docker on Stretch?

The recommended way to install Docker for Stretch is to use the upstream
Docker repositories.

"DontBreakDebian" is nice advice, not there are situations where you
have to use 3rd party repositories.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.

[toc] | [prev] | [next] | [standalone]


#206666

FromRoberto C. Sánchez <roberto@debian.org>
Date2019-03-27 14:50 +0100
Message-ID<xGh6h-Ke-5@gated-at.bofh.it>
In reply to#206664
On Wed, Mar 27, 2019 at 02:03:43PM +0100, Sven Hartge wrote:
> Luís Gomes <luismsgomes@gmail.com> wrote:
> 
> > However, I could not find a docker.io package on the main stretch
> > repository or in stretch-backports, which makes me ask what is the
> > Debian-recommended-way to install Docker on Stretch?
> 
> The recommended way to install Docker for Stretch is to use the upstream
> Docker repositories.
> 
> "DontBreakDebian" is nice advice, not there are situations where you
> have to use 3rd party repositories.
> 
However, given that buster is going to be released in a matter of
months, an upgrade might also be a viable route.

Regards,

-Roberto

-- 
Roberto C. Sánchez

[toc] | [prev] | [next] | [standalone]


#206669

FromSven Hartge <sven@svenhartge.de>
Date2019-03-27 15:10 +0100
Message-ID<xGhpE-16l-15@gated-at.bofh.it>
In reply to#206666
Roberto C. Sánchez <roberto@debian.org> wrote:
> On Wed, Mar 27, 2019 at 02:03:43PM +0100, Sven Hartge wrote:
>> Luís Gomes <luismsgomes@gmail.com> wrote:
 
>>> However, I could not find a docker.io package on the main stretch
>>> repository or in stretch-backports, which makes me ask what is the
>>> Debian-recommended-way to install Docker on Stretch?
 
>> The recommended way to install Docker for Stretch is to use the
>> upstream Docker repositories.
 
>> "DontBreakDebian" is nice advice, not there are situations where you
>> have to use 3rd party repositories.

> However, given that buster is going to be released in a matter of
> months, an upgrade might also be a viable route.

Running an unreleased Debian version on a production system? No way.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.

[toc] | [prev] | [next] | [standalone]


#206670

FromRoberto C. Sánchez <roberto@debian.org>
Date2019-03-27 15:20 +0100
Message-ID<xGhzj-19m-9@gated-at.bofh.it>
In reply to#206669
On Wed, Mar 27, 2019 at 03:05:50PM +0100, Sven Hartge wrote:
> Roberto C. Sánchez <roberto@debian.org> wrote:
> > On Wed, Mar 27, 2019 at 02:03:43PM +0100, Sven Hartge wrote:
> >> Luís Gomes <luismsgomes@gmail.com> wrote:
>  
> >>> However, I could not find a docker.io package on the main stretch
> >>> repository or in stretch-backports, which makes me ask what is the
> >>> Debian-recommended-way to install Docker on Stretch?
>  
> >> The recommended way to install Docker for Stretch is to use the
> >> upstream Docker repositories.
>  
> >> "DontBreakDebian" is nice advice, not there are situations where you
> >> have to use 3rd party repositories.
> 
> > However, given that buster is going to be released in a matter of
> > months, an upgrade might also be a viable route.
> 
> Running an unreleased Debian version on a production system? No way.
> 
OK.  Whatever works for you.

The point I was making was that it is not a black and white matter.
Depending on the use case, a stable Debian system with a third party
docker package may not actually be a better solution than a testing
system with official Debian packages for Docker.  Then again, it may be
that the third-party packages on stable are the better approach.

That decision is ultimately up to Luís.

Regards,

-Roberto

-- 
Roberto C. Sánchez

[toc] | [prev] | [next] | [standalone]


#206667

FromPaul Sutton <zleap@disroot.org>
Date2019-03-27 15:00 +0100
Message-ID<xGhfY-NE-7@gated-at.bofh.it>
In reply to#206663
On 27/03/2019 12:59, Luís Gomes wrote:
> Hello everyone,
>
> I'm setting up a server with Debian Stretch and I need to install
> Docker.
>
> After reading the warning against installing software from unnoficial
> repositories from https://wiki.debian.org/DontBreakDebian I'm trying to
> follow this good advice.
>
> However, I could not find a docker.io package on the main stretch
> repository or in stretch-backports, which makes me ask what is the
> Debian-recommended-way to install Docker on Stretch?
>
>
> Thanks,
>
> Luís
>
>
Hi Luis

Firstly I am _not_ an expert at this,   I have recently, however
installed nextcloud into a docker instance.

using instructions from here

https://www.itzgeek.com/how-tos/linux/debian/how-to-install-docker-on-debian-9.html

However I did find that containers are stored in

/var/lib/docker

which caused a problem for me, as my / partition was small (about 30gb),
the rest of the system was /home

I re-installed debian and used / and /swap,  hence more space for the
containers.  As this is a home LAN system, it works fine for me.

I also found that restarting docker, also creates a new container each
time, problem as at the time I was testing next cloud, etc

I then found by using

docker run -d --restart="always" -p 8080:80 nextcloud

it started the same instance and the same container,

Before (I was'nt starting with '--restart="always"' and I ended up with
several containers, each time I restarted docker,  so my previous
container + user account were still there, just not loaded.    

Also found that

systemctl docker start

and

systemctl docker enable

the latter enables docker to start on boot, hence I can at least run the
docker / next cloud server headless (to a point at least)

Not sure if it is the recommended way though.

Hope this helps


Paul


-- 
Paul Sutton
http://www.zleap.net
https://www.linkedin.com/in/zleap/
gnupg : 7D6D B682 F351 8D08 1893  1E16 F086 5537 D066 302D

[toc] | [prev] | [next] | [standalone]


#206698

FromLinux-Fan <Ma_Sys.ma@web.de>
Date2019-03-28 00:40 +0100
Message-ID<xGqjg-6ut-1@gated-at.bofh.it>
In reply to#206667

[Multipart message — attachments visible in raw view] — view raw

Paul Sutton writes:

> On 27/03/2019 12:59, Luís Gomes wrote:
> > Hello everyone,
> >
> > I'm setting up a server with Debian Stretch and I need to install
> > Docker.

[...]

Hello,

for my Debian installations, I have basically followed the recommendations  
from the official Docker website:

https://docs.docker.com/install/linux/docker-ce/debian/

It describes multiple installation methods and I chose the one based on  
adding a repository.

[...]

> using instructions from here
>
> https://www.itzgeek.com/how-tos/linux/debian/how-to-install-docker-on- 
> debian-9.html

This guide is good except for the last point
``Allow non-root user to run Docker''. Think twice before doing that because  
Docker access is essentially equal to being root
(try `docker run --rm -it -v /:/mnt debian:9 /bin/bash` if you do not  
believe it*** :) ).

> However I did find that containers are stored in
>
> /var/lib/docker
>
> which caused a problem for me, as my / partition was small (about 30gb),

This is good to know in advance, yes!

While one is at ensuring enough storage is available, it also makes sense to  
check that Docker runs with backend overlay2. To do this, check `docker info`
output. A change of storage backend can be achieved by passing
`--storage-driver=overlay2` to the daemon or by creating a suitable json  
configuration file.

It is recommendable to do this before even running the hello-world example  
(probably even before starting the Docker daemon for the first time, but  
then `docker info` is not available), because it will cause Docker to no  
longer be able to read containers and images from before switching the  
storage backend.

[...]

> I also found that restarting docker, also creates a new container each
> time, problem as at the time I was testing next cloud, etc

Interesting. For me, it only stops all the containers without proper
`--restart` parameter. I have never seen a docker upgrade create additional  
containers. Did you possibly run `docker run` again because that would always  
create a new container?

> I then found by using
>
> docker run -d --restart="always" -p 8080:80 nextcloud
>
> it started the same instance and the same container,
>
> Before (I was'nt starting with '--restart="always"' and I ended up with
> several containers, each time I restarted docker,  so my previous
> container + user account were still there, just not loaded.    

[...]

Please note that the recommended Docker way of dealing with this issue is to  
put data in a separate volume (or my preference: store it locally on the  
machine in a file-system location) like this (create `/srv/nextcloud` or any  
other suitable path first):

docker run -d --restart=always -p 8080:80 -v /srv/nextcloud:/var/www/html nextcloud

This way, you can update your container by issuing `docker pull nextcloud`  
and then stopping the container and re-running the command. If everything is  
OK, the update worked and the old container can be deleted which will  
usually cause the space of the old image to be freed as well... if not:  
restart the old container and hope the DB schema did not change (not sure  
how/if nextcloud handles/needs this...).

It might also be advisable to not take the `:latest` tag but rather a  
specific version like nextcloud:15-fpm or such. This way, new releases will  
not come by surprise when doing `docker pull nextcloud:15-fpm` but only  
after consciously deciding for a new release.

This mail is not strictly all on the topic of installing Docker but I hope  
this post is still useful for everyone getting started with it :)

***) `--rm` does not mean: Delete my data here (it just deletes the  
container after exit), but in case of doubt one may as well try the command  
without the `--rm` :)

HTH
Linux-Fan 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web