Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check docker and docker compose version on menu start #28

Closed
Slyke opened this issue Apr 21, 2020 · 0 comments · Fixed by #32
Closed

Check docker and docker compose version on menu start #28

Slyke opened this issue Apr 21, 2020 · 0 comments · Fixed by #32
Labels
enhancement New feature or request

Comments

@Slyke
Copy link
Collaborator

Slyke commented Apr 21, 2020

Taken from: https://stackoverflow.com/questions/38839444/in-ssh-shell-script-check-for-docker-version

SERVER_VERSION=$(docker version -f "{{.Server.Version}}")
SERVER_VERSION_MAJOR=$(echo "$SERVER_VERSION"| cut -d'.' -f 1)
SERVER_VERSION_MINOR=$(echo "$SERVER_VERSION"| cut -d'.' -f 2)
SERVER_VERSION_BUILD=$(echo "$SERVER_VERSION"| cut -d'.' -f 3)

if [ "${SERVER_VERSION_MAJOR}" -ge 19 ] && \
   [ "${SERVER_VERSION_MINOR}" -ge 0 ]  && \
   [ "${SERVER_VERSION_BUILD}" -ge 3 ]; then
    echo "Docker version >= 19.0.3 it's ok"
else
    echo "Docker version less than 19.0.3 can't continue"
    exit 1
fi

When the script is starting, warn the user if they do not have the minimum docker version (as specified: https://docs.docker.com/compose/compose-file/compose-versioning/ ) of 18.02.0+

@Slyke Slyke added the enhancement New feature or request label Apr 21, 2020
@Slyke Slyke linked a pull request Apr 21, 2020 that will close this issue
@Slyke Slyke closed this as completed in #32 Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant