improved docker image build
This commit is contained in:
parent
59ea5a3e11
commit
45b4e6dcf9
2 changed files with 20 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
FROM eclipse-temurin:17-jdk-focal
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./build/libs/* ./app.jar
|
||||
COPY ./build/libs/* ./nextcloud-dlna.jar
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["java","-jar","app.jar"]
|
||||
CMD ["java","-jar","nextcloud-dlna.jar"]
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=`./gradlew currentVersion | grep "Project version" | awk -F"version: " '{ print $2 }'`
|
||||
|
||||
echo "This will create docker image for version $version."
|
||||
read -p "Continue [y/n]? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
./gradlew clean build || exit
|
||||
|
||||
docker buildx create \
|
||||
--use \
|
||||
--platform=linux/arm/v7,linux/arm64/v8,linux/amd64 \
|
||||
|
@ -5,6 +18,11 @@ docker buildx create \
|
|||
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform=linux/arm/v7,linux/arm64/v8,linux/amd64 \
|
||||
--tag=thanek/nextcloud-dlna:$version .
|
||||
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform=linux/arm/v7,linux/arm64/v8,linux/amd64 \
|
||||
|
|
Loading…
Reference in a new issue