Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Kali 2017.1 x64, Docker-ce Install script
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker*
# install dependencies 4 cert
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
# add Docker repo gpg key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
echo "deb https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list
sudo apt-get update
# install Docker
sudo apt-get install docker-ce
# run Hellow World image
sudo docker run hello-world
# manage Docker as a non-root user
sudo groupadd docker
sudo usermod -aG docker $USER
# configure Docker to start on boot
sudo systemctl enable docker
@nikallass

This comment has been minimized.

Show comment Hide comment
@nikallass

nikallass May 30, 2017

I spend a lot of time to install docker on kali linux x64. x32 is not supported. So here is the solution.

Owner

nikallass commented May 30, 2017

I spend a lot of time to install docker on kali linux x64. x32 is not supported. So here is the solution.

@rotelok

This comment has been minimized.

Show comment Hide comment
@rotelok

rotelok Jun 8, 2017

change line 16 from
echo "deb https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list
to
echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list

so it doesn't break on multilib systems, or else you will get the following error.
"N: Skipping acquire of configured file 'stable/binary-i386/Packages' as repository 'https://download.docker.com/linux/debian stretch InRelease' doesn't support architecture 'i386'"

rotelok commented Jun 8, 2017

change line 16 from
echo "deb https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list
to
echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list

so it doesn't break on multilib systems, or else you will get the following error.
"N: Skipping acquire of configured file 'stable/binary-i386/Packages' as repository 'https://download.docker.com/linux/debian stretch InRelease' doesn't support architecture 'i386'"

@lgalke

This comment has been minimized.

Show comment Hide comment
@lgalke

lgalke Jun 29, 2017

Thanks for this one.

lgalke commented Jun 29, 2017

Thanks for this one.

@starnightcyber

This comment has been minimized.

Show comment Hide comment
@starnightcyber

starnightcyber Jul 10, 2017

Thanks...
Running this script met a small question, with --fix-missing option solved this problem .

Thanks...
Running this script met a small question, with --fix-missing option solved this problem .

@ktec

This comment has been minimized.

Show comment Hide comment
@ktec

ktec Nov 6, 2017

Amazing, thanks for sharing 🌮 🎉

ktec commented Nov 6, 2017

Amazing, thanks for sharing 🌮 🎉

@marxenegls

This comment has been minimized.

Show comment Hide comment
@marxenegls

marxenegls Dec 2, 2017

kept getting permission denied at editing apt/sources i know it should be an extra entry under apt/sources.list.d and

sudo touch create file docker_ce.list first than echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker_ce.list ..
sudo gpasswd -a $USER docker ( -d to remove)
...to run docker without sudo but keep in mind it is a risk (https://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/)
(docker run -ti --privileged -v /:/host fedora chroot /host | ouch)
i have a small 1.3Ghz x2 /6GB mem notebook and i didn't want to install stuff like mutillidae and mess around with versions of php potentially corrupt my vhosts and site on apache , that's why i've chosen to set up docker i also know there's a mutillidae img, webgoat etc that runs ok out of the box

marxenegls commented Dec 2, 2017

kept getting permission denied at editing apt/sources i know it should be an extra entry under apt/sources.list.d and

sudo touch create file docker_ce.list first than echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker_ce.list ..
sudo gpasswd -a $USER docker ( -d to remove)
...to run docker without sudo but keep in mind it is a risk (https://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/)
(docker run -ti --privileged -v /:/host fedora chroot /host | ouch)
i have a small 1.3Ghz x2 /6GB mem notebook and i didn't want to install stuff like mutillidae and mess around with versions of php potentially corrupt my vhosts and site on apache , that's why i've chosen to set up docker i also know there's a mutillidae img, webgoat etc that runs ok out of the box

@JaewoongMoon

This comment has been minimized.

Show comment Hide comment
@JaewoongMoon

JaewoongMoon Jan 19, 2018

Thanks!

Thanks!

@Rovel

This comment has been minimized.

Show comment Hide comment
@Rovel

Rovel Jan 24, 2018

I'm very happy!
Thanks my friend

Rovel commented Jan 24, 2018

I'm very happy!
Thanks my friend

@sinwe

This comment has been minimized.

Show comment Hide comment
@sinwe

sinwe Mar 3, 2018

I keep getting following error

Setting up docker-ce (17.12.1ce-0debian) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2018-03-03 22:58:16 +08; 10ms ago
Docs: https://docs.docker.com
Process: 32576 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 32576 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1

sinwe commented Mar 3, 2018

I keep getting following error

Setting up docker-ce (17.12.1ce-0debian) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2018-03-03 22:58:16 +08; 10ms ago
Docs: https://docs.docker.com
Process: 32576 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 32576 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1

@floppyfish212

This comment has been minimized.

Show comment Hide comment
@floppyfish212

floppyfish212 Mar 13, 2018

Good stuff, mate!

Good stuff, mate!

@wadleo

This comment has been minimized.

Show comment Hide comment
@wadleo

wadleo Mar 31, 2018

great, it works well, thanks

wadleo commented Mar 31, 2018

great, it works well, thanks

@hamaMk

This comment has been minimized.

Show comment Hide comment
@hamaMk

hamaMk Apr 8, 2018

thanks a lot...

hamaMk commented Apr 8, 2018

thanks a lot...

@chekamarue

This comment has been minimized.

Show comment Hide comment
@chekamarue

chekamarue Apr 29, 2018

worked very well
thanks

worked very well
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment