💚 fix dockerfile

This commit is contained in:
naiba 2022-07-07 13:38:44 +08:00
parent 66d3e83e99
commit 9419b02cd3
3 changed files with 15 additions and 19 deletions

View File

@ -33,22 +33,16 @@ jobs:
dest: dist dest: dist
pkg: cmd/dashboard pkg: cmd/dashboard
prefix: dashboard prefix: dashboard
targets: linux/amd64,linux/arm64,linux/arm-7,linux/386,linux/s390x targets: linux/amd64,linux/arm64,linux/arm-7,linux/386,linux/s390x,linux/riscv64
v: true v: true
x: false x: false
race: false race: false
ldflags: -s -w ldflags: -s -w
buildmode: default buildmode: default
- name: move dist - name: fix dist
run: | run: |
mkdir -p target/linux/{arm,arm64,386,amd64,s390x} cp dist/dashboard-linux-arm-7 dist/dashboard-linux-arm
mkdir target/linux/arm/v7/
mv dist/dashboard-linux-arm-7 target/linux/arm/v7/dashboard
mv dist/dashboard-linux-arm64 target/linux/arm64/dashboard
mv dist/dashboard-linux-386 target/linux/386/dashboard
mv dist/dashboard-linux-amd64 target/linux/amd64/dashboard
mv dist/dashboard-linux-s390x target/linux/s390x/dashboard
- name: Log in to the GHCR - name: Log in to the GHCR
uses: docker/login-action@master uses: docker/login-action@master
@ -86,7 +80,7 @@ jobs:
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm,linux/386,linux/s390x platforms: linux/amd64,linux/arm64,linux/arm,linux/386,linux/s390x,linux/riscv64
push: true push: true
tags: | tags: |
${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }} ${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }}

View File

@ -1,20 +1,22 @@
FROM ubuntu:latest ARG TARGETARCH
ARG TARGETOS
FROM $TARGETARCH/ubuntu:20.04
ARG TARGETPLATFORM
ENV TZ="Asia/Shanghai" ENV TZ="Asia/Shanghai"
COPY ./script/entrypoint.sh /entrypoint.sh COPY ./script/entrypoint.sh /entrypoint.sh
RUN export DEBIAN_FRONTEND="noninteractive" && RUN export DEBIAN_FRONTEND="noninteractive" && \
apt update && apt install -y ca-certificates tzdata && apt update && apt install -y ca-certificates tzdata && \
update-ca-certificates && update-ca-certificates && \
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure tzdata && dpkg-reconfigure tzdata && \
chmod +x /entrypoint.sh chmod +x /entrypoint.sh
WORKDIR /dashboard WORKDIR /dashboard
COPY ./resource ./resource COPY ./resource ./resource
COPY target/$TARGETPLATFORM/dashboard ./app COPY dist/dashboard-$TARGETOS-$TARGETARCH ./app
VOLUME ["/dashboard/data"] VOLUME ["/dashboard/data"]
EXPOSE 80 5555 EXPOSE 80 5555

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
echo -e "nameserver 127.0.0.11\nnameserver 8.8.8.8\nnameserver 223.5.5.5\n" > /etc/resolv.conf echo -e "nameserver 127.0.0.11\nnameserver 8.8.4.4\nnameserver 223.5.5.5\n" > /etc/resolv.conf
/dashboard/app /dashboard/app