Skip to content

Commit b8ab9b8

Browse files
author
Rafael Peria de Sene
committed
install_docker: initial commit
Signed-off-by: Rafael Peria de Sene <[email protected]>
1 parent 25c0189 commit b8ab9b8

File tree

2 files changed

+81
-2
lines changed

2 files changed

+81
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
# docker_on_power
2-
A simple script that automates the installation and configuration of Docker for ppc64le
1+
# Docker on Power
2+
3+
A simple script that automates the installation and configuration of Docker for ppc64le. That's all!
4+
5+
To execute it, ensure you are logged as #root, then just execute ./install_docker.sh.
6+
7+
You can allow an user to run Docker without sudo by executing the following commands:
8+
9+
# Add Docker group
10+
groupadd docker
11+
12+
# Add current user as member of the Docker group
13+
usermod -aG docker $USER
14+
15+
16+
Reboot when the installation is completed.

install_docker.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
set +e
4+
: '
5+
Licensed under the Apache License, Version 2.0 (the “License”);
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an “AS IS” BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
Rafael Sene <[email protected]>
16+
17+
'
18+
19+
if (( $EUID != 0 )); then
20+
echo "Please run as root"
21+
exit
22+
fi
23+
24+
# Remove any old Docker setup
25+
apt-get remove docker docker-engine docker.io -y
26+
27+
# Common Update
28+
apt-get update -y
29+
30+
# Install the repository
31+
apt-get install \
32+
apt-transport-https \
33+
ca-certificates \
34+
curl \
35+
software-properties-common
36+
37+
# Add Docker GPG Key
38+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
39+
40+
# Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
41+
apt-key fingerprint 0EBFCD88
42+
43+
# Set up the stable repository
44+
add-apt-repository \
45+
"deb [arch=ppc64el] https://download.docker.com/linux/ubuntu \
46+
$(lsb_release -cs) \
47+
stable"
48+
49+
# Common Update
50+
apt-get update -y
51+
52+
# Install Docker
53+
apt-get install docker-ce -y
54+
55+
# Run Hello World
56+
docker run hello-world
57+
58+
# Enable Docker service
59+
systemctl enable docker
60+
61+
# Enabling Docker Remote API on Ubuntu 16.04
62+
sed -i -- 's/ExecStart=\/usr\/bin\/dockerd -H fd:\/\//ExecStart=\/usr\/bin\/dockerd -H fd:\/\/ -H tcp:\/\/0.0.0.0:4243/g' /lib/systemd/system/docker.service
63+
systemctl daemon-reload
64+
service docker restart
65+
curl http://localhost:4243/version

0 commit comments

Comments
 (0)