💚 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
pkg: cmd/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
x: false
race: false
ldflags: -s -w
buildmode: default
- name: move dist
- name: fix dist
run: |
mkdir -p target/linux/{arm,arm64,386,amd64,s390x}
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
cp dist/dashboard-linux-arm-7 dist/dashboard-linux-arm
- name: Log in to the GHCR
uses: docker/login-action@master
@ -86,7 +80,7 @@ jobs:
with:
context: .
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
tags: |
${{ 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"
COPY ./script/entrypoint.sh /entrypoint.sh
RUN export DEBIAN_FRONTEND="noninteractive" &&
apt update && apt install -y ca-certificates tzdata &&
update-ca-certificates &&
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime &&
dpkg-reconfigure tzdata &&
RUN export DEBIAN_FRONTEND="noninteractive" && \
apt update && apt install -y ca-certificates tzdata && \
update-ca-certificates && \
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure tzdata && \
chmod +x /entrypoint.sh
WORKDIR /dashboard
COPY ./resource ./resource
COPY target/$TARGETPLATFORM/dashboard ./app
COPY dist/dashboard-$TARGETOS-$TARGETARCH ./app
VOLUME ["/dashboard/data"]
EXPOSE 80 5555

View File

@ -1,3 +1,3 @@
#!/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