Compare commits

..

2 Commits

Author SHA1 Message Date
Tuan-Dat Tran 991cb57c88 Updated Versioning and switchted to buildx
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-07-25 10:21:56 +02:00
Tuan-Dat Tran 1fbc2b7521 Modified docker push to use buildkit
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-07-25 03:49:16 +02:00
2 changed files with 19 additions and 8 deletions

View File

@ -1,9 +1,9 @@
FROM rust:1.77.2 as dioxus
FROM rust:1.79.0 AS dioxus
RUN cargo install dioxus-cli@^0.5
FROM dioxus as builder
FROM dioxus AS builder
WORKDIR /athome/
RUN apt-get update && apt-get install nodejs npm -y && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install nodejs npm libssl-dev musl-tools -y && rm -rf /var/lib/apt/lists/*
RUN npm install -D tailwindcss
COPY ./src/ ./src/
COPY ./assets/ ./assets/
@ -13,7 +13,7 @@ COPY ./Dioxus.toml ./Dioxus.toml
COPY ./tailwind.config.js ./tailwind.config.js
RUN npx tailwindcss -i ./input.css -o ./assets/tailwind.css && dx build --platform fullstack --release
FROM dioxus as runner
FROM dioxus AS runner
WORKDIR /app/
COPY --from=builder /athome/docs/ ./docs/
CMD [ "./docs/athome" ]

View File

@ -1,9 +1,20 @@
#!/bin/sh
VERSION=0.1.2
TAG=$(git branch | grep "*" | awk '{ print $2 }')
LOCAL_IMAGE="athome"
REGISTRY="mos4"
REMOTE_IMAGE="athome"
DOCKERFILE="./Dockerfile"
docker build -t $LOCAL_IMAGE .
docker tag $LOCAL_IMAGE:latest mos4/$REMOTE_IMAGE:$VERSION
docker push mos4/$REMOTE_IMAGE:$VERSION
echo "DOCKERFILE: $DOCKERFILE"
echo "TAG: $TAG"
echo "LOCAL_IMAGE: $LOCAL_IMAGE"
echo "REGISTRY: $REGISTRY"
echo "REMOTE_IMAGE: $REMOTE_IMAGE"
#docker buildx build --platform linux/amd64,linux/arm64 -f ${DOCKERFILE} -t \
# ${REGISTRY}/${REMOTE_IMAGE}:${TAG} . --push
docker buildx build --platform linux/amd64 -f ${DOCKERFILE} \
-t ${REGISTRY}/${REMOTE_IMAGE}:${TAG} \
-t ${REGISTRY}/${REMOTE_IMAGE}:latest . --push