fix: docker file

This commit is contained in:
王性驊 2025-03-12 15:30:43 +08:00
parent b83ee9990c
commit 74d095bcbc
5 changed files with 37 additions and 7 deletions

View File

@ -6,7 +6,7 @@ GOFMT ?= gofmt "-s"
GOFILES := $(shell find . -name "*.go") GOFILES := $(shell find . -name "*.go")
LDFLAGS := -s -w LDFLAGS := -s -w
VERSION="v1.0.1" VERSION="v1.0.1"
DOCKER_REPO="reg.wang/app-cloudep-permission-service" DOCKER_REPO="container.wang/app-cloudep-permission-service"
.PHONY: test .PHONY: test
test: # 進行測試 test: # 進行測試

View File

@ -2,11 +2,12 @@
# BUILDER # # BUILDER #
########### ###########
FROM golang:1.24.0 AS builder FROM golang:1.24.0 as builder
ARG VERSION ARG VERSION
ARG BUILT ARG BUILT
ARG GIT_COMMIT ARG GIT_COMMIT
ARG SSH_PRV_KEY
# private go packages # private go packages
ENV GOPRIVATE=code.30cm.net ENV GOPRIVATE=code.30cm.net
@ -16,12 +17,15 @@ COPY . .
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y git && \ apt-get install git
mkdir /root/.ssh
# Make the root foler for our ssh # Make the root foler for our ssh
RUN --mount=type=secret,id=ssh_key,dst=/root/.ssh/id_rsa \ RUN mkdir -p /root/.ssh && \
ssh-keyscan git.30cm.net >> /root/.ssh/known_hosts chmod 0700 /root/.ssh && \
ssh-keyscan git.30cm.net > /root/.ssh/known_hosts && \
echo "$SSH_PRV_KEY" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa
RUN --mount=type=ssh go mod download RUN --mount=type=ssh go mod download

View File

@ -0,0 +1,22 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.8.1
// Source: permission.proto
package server
import (
"code.30cm.net/digimon/app-cloudep-permission-server/gen_result/pb/permission"
"code.30cm.net/digimon/app-cloudep-permission-server/internal/logic/permissionservice"
"code.30cm.net/digimon/app-cloudep-permission-server/internal/svc"
)
type PermissionServiceServer struct {
svcCtx *svc.ServiceContext
permission.UnimplementedPermissionServiceServer
}
func NewPermissionServiceServer(svcCtx *svc.ServiceContext) *PermissionServiceServer {
return &PermissionServiceServer{
svcCtx: svcCtx,
}
}

View File

@ -1,5 +1,5 @@
// Code generated by goctl. DO NOT EDIT. // Code generated by goctl. DO NOT EDIT.
// goctl 1.7.3 // goctl 1.8.1
// Source: permission.proto // Source: permission.proto
package server package server

View File

@ -15,6 +15,10 @@ func (use *additional) GetAll() map[string]string {
} }
func (use *additional) Set(key token.Additional, val string) { func (use *additional) Set(key token.Additional, val string) {
if use.additional == nil {
use.additional = make(map[string]string)
}
use.additional[key.String()] = val use.additional[key.String()] = val
} }