Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
moqui
/
k8s-moqui
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
cf7c9f99
authored
2022-10-27 14:10:02 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add support for git submodules.
1 parent
a8d7461a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
5 deletions
Dockerfile
build.sh
fix-git-submodules
Dockerfile
View file @
cf7c9f9
# syntax=docker/dockerfile:1.4
# Builds a minimal docker image with openjdk and moqui with various volumes for configuration and persisted data outside the container
# NOTE: add components, build and if needed load data before building a docker image with this
ARG RUNTIME_IMAGE=eclipse-temurin:11-jdk
...
...
@@ -5,7 +6,7 @@ FROM ${RUNTIME_IMAGE} AS moqui-base
RUN
true
\
&&
apt-get update
\
&&
apt-get install -y unzip less
\
&&
apt-get install -y unzip less
git
\
&&
apt-get clean
&&
rm -rf /var/lib/apt/lists/
*
\
&&
groupadd -g 1000 moqui
\
&&
useradd -u 1000 -g 1000 -G 0 -d /opt/moqui moqui
\
...
...
@@ -27,9 +28,18 @@ FROM moqui-base AS moqui-build
WORKDIR
/opt/moqui-build
COPY framework/ ./
COPY runtime/ runtime/
COPY component/ runtime/component/
RUN
[
"mkdir"
,
"/opt/moqui-scripts"
]
COPY --from=moqui-builder fix-git-submodules /opt/moqui-scripts/fix-git-submodules
COPY ./ /opt/moqui-app/
RUN
[
"/opt/moqui-scripts/fix-git-submodules"
,
"-start"
,
"/opt/moqui-app"
]
RUN
true
&&
set
-x
\
&&
rm -rf /opt/moqui-build
&&
ln -sf /opt/moqui-app/framework /opt/moqui-build
\
&&
rm -rf /opt/moqui-build/runtime
&&
ln -sf /opt/moqui-app/runtime /opt/moqui-build/runtime
\
&&
rm -rf /opt/moqui-build/runtime/component
&&
ln -sf /opt/moqui-app/component /opt/moqui-build/runtime/component
\
&&
true
RUN
[
"./gradlew"
,
"--no-daemon"
,
"--info"
,
"build"
,
"addRuntime"
]
...
...
build.sh
View file @
cf7c9f9
#!/bin/bash
set
-e
TAG
=
test
-latest
APP
=
moqui-app
PUSH_TO
=
docker://5.161.91.120:31234
PREFIX
=
declare
-a
images
=(
moqui-jdbc-drivers moqui-app
)
TOP_DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
-P
)
"
_build
()
{
for
image
in
"
${
images
[@]
}
"
;
do
docker build
-f Dockerfile
--tag
"
${
PREFIX
}${
image
}
:
${
TAG
}
"
--target
"
${
image
}
"
"
${
APP
}
"
docker build
x build --progress plain --build-context
"moqui-builder=
$TOP_DIR
"
-f
"
${
TOP_DIR
}
/Dockerfile"
--tag
"
${
PREFIX
}${
image
}
:
${
TAG
}
"
--target
"
${
image
}
"
"
${
APP
}
"
done
}
...
...
fix-git-submodules
0 → 100755
View file @
cf7c9f9
#!/bin/bash
set
-ex
cmd
=
"
$1
"
shift
case
"
$cmd
"
in
(
-start
)
dir
=
"
$1
"
shift
find
"
$dir
"
-type f -name
'.git'
-exec
"
$0
"
-fix
"
$dir
"
'{}'
\;
;;
(
-fix
)
dir
=
"
$1
"
gitdir_link
=
"
$2
"
gitdir_dir
=
"
$(
dirname
"
$gitdir_link
"
)
"
read
gitdir_token gitdir_location <
"
$gitdir_link
"
case
"
$gitdir_location
"
in
(
/
*
)
echo
"Can't handle absolute gitdir location:
$gitdir_location
"
1>&2
exit
1
;;
esac
cd
"
$gitdir_dir
"
pushd
"
$gitdir_location
"
git config --unset core.worktree
popd
rm .git
mv
"
$gitdir_location
"
.git
;;
esac
Please
register
or
sign in
to post a comment