Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
webarch
scripts
Commits
f1eebe72
Commit
f1eebe72
authored
Nov 06, 2019
by
Chris Croome
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docker Compose install script added
parent
b0d1b72b
Pipeline
#9921
passed with stage
in 24 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
bin/install-docker-compose.sh
bin/install-docker-compose.sh
+27
-0
No files found.
bin/install-docker-compose.sh
0 → 100755
View file @
f1eebe72
#!/usr/bin/env bash
set
-e
DOWNLOAD_DIR
=
"/usr/local/src"
if
[[
!
-d
${
DOWNLOAD_DIR
}
]]
;
then
mkdir
-p
"
${
DOWNLOAD_DIR
}
"
fi
LATEST_VERSION
=
$(
curl
-sI
https://github.com/docker/compose/releases/latest |
grep
^Location |
sed
's;^Location: https:/;;'
|
sed
's/\r$//'
|
awk
-F
"/"
'{print $NF}'
)
KERNEL
=
$(
uname
-s
)
MACHINE
=
$(
uname
-m
)
LATEST_VERSION_URL
=
"https://github.com/docker/compose/releases/download/
${
LATEST_VERSION
}
/docker-compose-
${
KERNEL
}
-
${
MACHINE
}
"
# Download the latest version and the checksum
curl
-sL
"
${
LATEST_VERSION_URL
}
"
-o
"
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
"
||
{
echo
"Error downloading Docker Compose"
;
exit
1
;
}
curl
-sL
"
${
LATEST_VERSION_URL
}
.sha256"
-o
"
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
.sha256"
||
{
echo
"Error downloading Docker Compose checksum"
;
exit
1
;
}
# Check the checksum
if
[[
-f
"
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
.sha256"
]]
;
then
grep
$(
sha256sum
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
|
awk
'{ print $1 }'
)
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
.sha256
||
{
echo
"Checksum didn't match"
;
exit
1
;
}
mv
"
${
DOWNLOAD_DIR
}
/docker-compose.
${
LATEST_VERSION
}
"
/usr/local/bin/docker-compose
&&
chmod
755 /usr/local/bin/docker-compose
&&
{
echo
"Docker Compose
${
LATEST_VERSION
}
installed"
;
exit
0
;
}
else
echo
"Something went wrong"
exit
1
fi
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