Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-amazon-acc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docker-amazon-acc
Commits
edad2413
Commit
edad2413
authored
Jun 28, 2024
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update install.sh
parent
d1911b72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
20 deletions
+34
-20
install.sh
install.sh
+34
-20
No files found.
install.sh
View file @
edad2413
#!/bin/sh
#!/bin/
ba
sh
export
DEBIAN_FRONTEND
=
noninteractive
# Update package index
apt update
sudo
apt-get remove docker docker-engine docker.io containerd runc
# Install necessary prerequisites
sudo
apt-get
-y
update
apt
install
-y
apt-transport-https ca-certificates curl software-properties-common
sudo
apt-get
-y
install
\
apt-transport-https
\
ca-certificates
\
curl
\
gnupg-agent
\
software-properties-common
curl
-fsSL
https://download.docker.com/linux/ubuntu/gpg |
sudo
apt-key add -
# Add Docker’s official GPG key
sudo
apt-key fingerprint 0EBFCD88
curl
-fsSL
https://download.docker.com/linux/ubuntu/gpg | apt-key add -
sudo
add-apt-repository
\
# Add Docker APT repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
\
add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(
lsb_release
-cs
)
stable"
$(
lsb_release
-cs
)
\
stable"
sudo
apt-get
-y
update
# Update package index again
apt update
sudo
apt-get
-y
install
docker-ce docker-ce-cli containerd.io
# Install Docker
apt
install
-y
docker-ce
# Start and enable Docker
systemctl start docker
systemctl
enable
docker
docker run
-d
-p
80:9000
--name
=
port
--restart
=
always
-v
/var/run/docker.sock:/var/run/docker.sock portainer/portainer
# Verify Docker installation
docker
--version
# Create Docker group if it doesn't exist
if
!
getent group docker
>
/dev/null
;
then
groupadd docker
fi
# Add the current user to the Docker group
usermod
-aG
docker
$USER
# Install Portainer
docker volume create portainer_data
docker run
-d
-p
80:9000
--name
=
portainer
--restart
=
always
\
-v
/var/run/docker.sock:/var/run/docker.sock
\
-v
portainer_data:/data portainer/portainer-ce
# Verify Portainer installation
docker ps
-a
echo
"Docker and Portainer have been installed successfully. Portainer is running on port 80."
# End of script
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment