Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LakeDropsDrupalDev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Docker
LakeDropsDrupalDev
Commits
0136691a
Commit
0136691a
authored
6 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#5
Update existing container if image got updated
parent
b4262432
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
l3d
+16
-3
16 additions, 3 deletions
l3d
with
16 additions
and
3 deletions
l3d
+
16
−
3
View file @
0136691a
...
...
@@ -4,7 +4,7 @@ if [[ "$1" == "help" ]]; then
echo
"L3D - LakeDropsDrupalDev"
echo
"========================="
echo
""
echo
"Version: 1.
1
.0"
echo
"Version: 1.
2
.0"
echo
"Info and support: https://gitlab.lakedrops.com/docker/l3d"
exit
0
fi
...
...
@@ -45,11 +45,24 @@ if [[ "${COMPOSE_PROJECT_NAME}" == "" ]]; then
echo
"COMPOSE_PROJECT_NAME=
${
COMPOSE_PROJECT_NAME
}
"
>>
.env
fi
ID
=
$(
docker container
ls
-q
-f
name
=
${
COMPOSE_PROJECT_NAME
}
_l3d
)
if
[[
"
$1
"
==
"update"
]]
;
then
docker pull registry.lakedrops.com/docker/l3d:php-
${
PHP_VERSION
}
echo
"Updating the image ..."
STATUS
=
$(
docker pull registry.lakedrops.com/docker/l3d:php-
${
PHP_VERSION
}
)
if
[[
"
$STATUS
"
==
*
"Status: Image is up to date"
*
]]
;
then
echo
"Already up to date"
else
echo
"Image updated"
if
[[
-n
"
$ID
"
]]
;
then
echo
"Removing outdated container ..."
docker stop
${
COMPOSE_PROJECT_NAME
}
_l3d
docker
rm
${
COMPOSE_PROJECT_NAME
}
_l3d
ID
=
fi
fi
fi
ID
=
$(
docker container
ls
-q
-f
name
=
${
COMPOSE_PROJECT_NAME
}
_l3d
)
if
[[
-n
"
$ID
"
]]
;
then
docker start
${
COMPOSE_PROJECT_NAME
}
_l3d
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment