go-crawler的爬虫示例。
git clone [email protected]:lizongying/go-crawler-example.git my-crawler
cd my-crawler
go run cmd/multi_spider/*.go -c example.yml -n test1 -m once
make multi_spider
./releases/multi_spider -c prod.yml -n test1 -m once
go get -u github.com/lizongying/go-crawler@d66d834
go mod tidy
make
# cross platform
docker buildx create --use
docker buildx inspect --bootstrap
# https://github.com/docker/buildx/issues/290
# for amd64
docker buildx build --platform linux/amd64 -f ./cmd/example_spider/Dockerfile -t lizongying/go-crawler-example:test .
# for arm64(mac m1)
docker buildx build --platform linux/arm64 -f ./cmd/example_spider/Dockerfile -t lizongying/go-crawler-example:test . --load
# once
docker run -d lizongying/go-crawler-example:test -c example.yml -n levi -f TestList -m once
# manual
docker run -p 8090-9090:8090 -d lizongying/go-crawler-example:test -c example.yml