Linux 运行环境固定为 opencv-4.9.0 gdal-3.8.4 ubuntu-22.04
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/osgeo/gdal:ubuntu-small-latest-amd64
|
||||
FROM --platform=linux/amd64 ghcr.io/osgeo/gdal:ubuntu-small-3.8.4
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
@@ -16,8 +16,6 @@ RUN echo 'export PATH="/opt/go/bin:${PATH}"' >> /root/.bashrc
|
||||
|
||||
RUN cd /opt && git clone -b v0.36.1 https://github.com/hybridgroup/gocv.git && \
|
||||
cd gocv && \
|
||||
awk '{gsub(/libtbb2/, "libtbbmalloc2"); gsub(/libdc1394-22-dev/, "libdc1394-dev"); print}' Makefile > Makefile.tmp && \
|
||||
mv Makefile.tmp Makefile && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf gocv
|
||||
|
||||
25
Makefile
25
Makefile
@@ -1,6 +1,27 @@
|
||||
.DEFAULT_GOAL := out
|
||||
export DATE := $(shell date +%Y%m%d-%H:%M:%S)
|
||||
export COMPILE_LDFLAGS='-s -w -X "main.BuildDate=${DATE}" '
|
||||
export DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
|
||||
export LATEST_COMMIT := $(shell git log --pretty=format:'%h' -n 1)
|
||||
export BRANCH := $(shell git branch |grep -v "no branch"| grep \*|cut -d ' ' -f2)
|
||||
export BUILT_ON_IP := $(shell [ $$(uname) = Linux ] && hostname -i || hostname )
|
||||
export RUNTIME_VER := $(shell go version)
|
||||
export BUILT_ON_OS=$(shell uname -a)
|
||||
ifeq ($(BRANCH),)
|
||||
BRANCH := master
|
||||
endif
|
||||
|
||||
export COMMIT_CNT := $(shell git rev-list HEAD | wc -l | sed 's/ //g' )
|
||||
export BUILD_NUMBER := ${BRANCH}-${COMMIT_CNT}
|
||||
|
||||
export COMPILE_LDFLAGS='-s -w \
|
||||
-X "main.BuildDate=${DATE}" \
|
||||
-X "main.LatestCommit=${LATEST_COMMIT}" \
|
||||
-X "main.BuildNumber=${BUILD_NUMBER}" \
|
||||
-X "main.BuiltOnIP=${BUILT_ON_IP}" \
|
||||
-X "main.BuiltOnOs=${BUILT_ON_OS}" \
|
||||
-X "main.Branch=${BRANCH}" \
|
||||
-X "main.CommitCnt=${COMMIT_CNT}" \
|
||||
-X "main.RuntimeVer=${RUNTIME_VER}" '
|
||||
|
||||
out:
|
||||
GOOS=darwin GOARCH=arm64 go build -o bin/sjy01-imgproc-darwin-arm64 -ldflags=${COMPILE_LDFLAGS} cmd/*.go
|
||||
|
||||
|
||||
2
build.sh
2
build.sh
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
docker build -t nuknal/gdal38-cv49-builder -f Dockerfile.build .
|
||||
docker build --progress=plain -t nuknal/gdal38-cv49-builder -f Dockerfile.build .
|
||||
docker run -v .:/src nuknal/gdal38-cv49-builder sh -c "cd /src && make linux"
|
||||
|
||||
@@ -17,6 +17,7 @@ var rootCmd = &cobra.Command{
|
||||
Long: ``,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("preprocessing tools for SJY01 original image data")
|
||||
fmt.Println(version())
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
46
cmd/version.go
Normal file
46
cmd/version.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
// 版本信息
|
||||
|
||||
var (
|
||||
// BuildDate date string of when build was performed filled in by -X compile flag
|
||||
BuildDate string
|
||||
// LatestCommit date string of when build was performed filled in by -X compile flag
|
||||
LatestCommit string
|
||||
// BuildNumber date string of when build was performed filled in by -X compile flag
|
||||
BuildNumber string
|
||||
// BuiltOnIP date string of when build was performed filled in by -X compile flag
|
||||
BuiltOnIP string
|
||||
// BuiltOnOs date string of when build was performed filled in by -X compile flag
|
||||
BuiltOnOs string
|
||||
// RuntimeVer date string of when build was performed filled in by -X compile flag
|
||||
RuntimeVer string
|
||||
// Branch git branch
|
||||
Branch string
|
||||
// CommitCnt ...
|
||||
CommitCnt string
|
||||
// Version
|
||||
ShowVersion bool
|
||||
)
|
||||
|
||||
func version() string {
|
||||
v := fmt.Sprintf(`
|
||||
Main Version: v1.0.0-beta
|
||||
---------------------------------------------------------
|
||||
BUILT_ON_IP %s
|
||||
BUILT_ON_OS %s
|
||||
DATE %s
|
||||
LATEST_COMMIT %s
|
||||
BRANCH %s
|
||||
COMMIT_CNT %s
|
||||
BUILD_NUMBER %s
|
||||
RUNTIME_VER %s
|
||||
OpenCV Version 4.9.0
|
||||
GDAL Version 3.8.4
|
||||
---------------------------------------------------------
|
||||
`, BuiltOnIP, BuiltOnOs, BuildDate, LatestCommit, Branch, CommitCnt, BuildNumber, RuntimeVer)
|
||||
|
||||
return v
|
||||
}
|
||||
9
go.mod
9
go.mod
@@ -5,11 +5,15 @@ go 1.20
|
||||
require (
|
||||
github.com/airbusgeo/godal v0.0.11
|
||||
github.com/duke-git/lancet/v2 v2.3.1
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12
|
||||
github.com/nuknal/goNum v0.0.0-20240712030226-6452806523e8
|
||||
github.com/paulmach/orb v0.11.1
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/spf13/viper v1.18.2
|
||||
gocv.io/x/gocv v0.36.1
|
||||
gonum.org/v1/plot v0.14.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -18,7 +22,7 @@ require (
|
||||
git.sr.ht/~sbinet/gg v0.5.0 // indirect
|
||||
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
|
||||
github.com/campoy/embedmd v1.0.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/chfenger/goNum v0.0.0-20191211064013-a00d841c1e7b // indirect
|
||||
github.com/go-fonts/liberation v0.3.2 // indirect
|
||||
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
|
||||
github.com/go-pdf/fpdf v0.9.0 // indirect
|
||||
@@ -34,8 +38,6 @@ require (
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 // indirect
|
||||
github.com/nuknal/goNum v0.0.0-20240712030226-6452806523e8 // indirect
|
||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||
github.com/onsi/gomega v1.33.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
@@ -60,7 +62,6 @@ require (
|
||||
golang.org/x/oauth2 v0.16.0 // indirect
|
||||
golang.org/x/term v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
gonum.org/v1/plot v0.14.0 // indirect
|
||||
google.golang.org/api v0.155.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
|
||||
|
||||
4
go.sum
4
go.sum
@@ -767,6 +767,7 @@ cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcP
|
||||
cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
|
||||
git.sr.ht/~sbinet/cmpimg v0.1.0 h1:E0zPRk2muWuCqSKSVZIWsgtU9pjsw3eKHi8VmQeScxo=
|
||||
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
|
||||
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
|
||||
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
|
||||
@@ -886,7 +887,9 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
|
||||
github.com/go-fonts/dejavu v0.3.2 h1:3XlHi0JBYX+Cp8n98c6qSoHrxPa4AUKDMKdrh/0sUdk=
|
||||
github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
|
||||
github.com/go-fonts/latin-modern v0.3.2 h1:M+Sq24Dp0ZRPf3TctPnG1MZxRblqyWC/cRUL9WmdaFc=
|
||||
github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
|
||||
github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
|
||||
github.com/go-fonts/liberation v0.3.2 h1:XuwG0vGHFBPRRI8Qwbi5tIvR3cku9LUfZGq/Ar16wlQ=
|
||||
@@ -2135,6 +2138,7 @@ modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
||||
Reference in New Issue
Block a user