nivin-studio / gonivinck Goto Github PK
View Code? Open in Web Editor NEW一个基于docker的go-zero运行环境。
一个基于docker的go-zero运行环境。
您好,请问这个仓库可以提供消息中间件的使用吗?比如zookeeper kafka或者rabbitmq,或者欢迎提pr吗?我也可以做这个部分的内容。
stat: cannot statx '/usr/bin/screen': Operation not permitted
dpkg: error processing package screen (--configure):
installed screen package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.31-13+deb11u2) ...
Errors were encountered while processing:
screen
E: Sub-process /usr/bin/dpkg returned an error code (1)
ERROR: Service 'golang' failed to build : The command '/bin/sh -c sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends curl zip unzip git vim screen' returned a non-zero code: 100
[internal] load metadata for docker.io/library/mysql:5.7:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:afc453de0d675083ac00d0538521f8a9a67d1cce180d70fab9925ebcc87a0eba: not found
ERROR: Service 'mysql' failed to build : Build failed
如题,希望一起提供 .devcontainer
开发环境,在vscode中开发使用.
贴一个我正在用的参照,使用 vscode的 remote-devcontainer
生成的默认配置修改后使用:
// devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/go-postgres
{
"name": "Go",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go",
"plex.vscode-protolint",
"peterj.proto",
"xiaoxin-technology.goctl"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5432],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
// docker-compose.yml
version: '3.8'
volumes:
mysql-data:
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
# [Choice] Go version 1, 1.18, 1.17
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
VARIANT: 1-bullseye
# Options
NODE_VERSION: "lts/*"
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env
# Security Opt and cap_add allow for C++ based debuggers to work.
# See `runArgs`: https://github.com/Microsoft/vscode-docs/blob/main/docs/remote/devcontainerjson-reference.md
# security_opt:
# - seccomp:unconfined
# cap_add:
# - SYS_PTRACE
volumes:
- ..:/workspace:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
# Uncomment the next line to use a non-root user for all processes.
# user: vscode
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
db:
image: mariadb:latest
restart: unless-stopped
volumes:
- mysql-data:/var/lib/mysql
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env
redis:
image: redis
etcd:
image: bitnami/etcd
# Dockerfile
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.18, 1.17, 1-bullseye, 1.18-bullseye, 1.17-bullseye, 1-buster, 1.18-buster, 1.17-buster
ARG VARIANT=1-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
USER vscode
RUN go env -w GOPROXY=https://goproxy.cn
RUN GOPROXY=https://goproxy.cn/,direct go install github.com/zeromicro/go-zero/tools/goctl@latest
RUN goctl env check -i -f --verbose
RUN chmod +x /go/bin/protoc
USER root
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment the next lines to use go get to install anything else you need
# USER vscode
# RUN go get -x <your-dependency-or-tool>
# USER root
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
期待上一个etcd-manage在线版本!这个很实用!
--initialize specified but the data directory has files in it. Aborting.
错误日志中就是这样的错误。docker-compose文件没有修改。请问应该怎么解决这个问题。
[3/7] RUN GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli:
#6 0.594 go: downloading github.com/tal-tech/go-zero/tools/goctl v1.2.5-0.20211230073016-b98d46bfd629
#6 1.031 go: downloading github.com/tal-tech/go-zero v1.2.5-0.20211230073016-b98d46bfd629
#6 1.441 go: downloading github.com/tal-tech/go-zero v1.2.5-0.20211230062155-e4ab51857606
#6 1.441 go: downloading github.com/logrusorgru/aurora v2.0.3+incompatible
#6 1.449 go: downloading github.com/urfave/cli v1.22.5
#6 1.787 go: downloading github.com/iancoleman/strcase v0.2.0
#6 1.793 go: downloading github.com/go-sql-driver/mysql v1.6.0
#6 1.950 go: downloading go.opentelemetry.io/otel/trace v1.1.0
#6 2.017 go: downloading github.com/fatih/structtag v1.2.0
#6 2.082 go: downloading github.com/zeromicro/antlr v0.0.1
#6 2.124 go: downloading github.com/lib/pq v1.10.3
#6 2.323 go: downloading github.com/emicklei/proto v1.9.1
#6 2.338 go: downloading go.uber.org/automaxprocs v1.4.0
#6 2.344 go: downloading go.opentelemetry.io/otel v1.1.0
#6 2.459 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
#6 2.506 go: downloading gopkg.in/yaml.v2 v2.4.0
#6 2.507 go: downloading github.com/zeromicro/ddl-parser v0.0.0-20210712021150-63520aca7348
#6 2.528 go: downloading github.com/spaolacci/murmur3 v1.1.0
#6 2.719 go: downloading github.com/russross/blackfriday/v2 v2.0.1
#6 2.830 go: downloading github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521184019-c5ad59b459ec
#6 2.962 go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
#6 34.81 go build github.com/zeromicro/ddl-parser/gen: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli]: exit code: 1
作者你好,最近在学习的时候发现Dockerfile中goctl的最新版本无法和go-zero-mall仓库的依赖对应,而指定使用[email protected]版本可以兼容go-zero-mall仓库代码中的go.mod依赖。
executor failed running [/bin/sh -c GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli]: exit code: 1
ERROR: Service 'golang' failed to build`
构建过程:
=> [3/7] RUN GOPROXY=https://goproxy.io/,direct go install github.com/zeromicro/go-zero/tools/goctl@latest 33.8s
=> => # go: downloading go.uber.org/automaxprocs v1.4.0
=> => # go: downloading gopkg.in/yaml.v2 v2.4.0
=> => # go: downloading github.com/zeromicro/ddl-parser v0.0.0-20210712021150-63520aca7348
=> => # go: downloading github.com/spaolacci/murmur3 v1.1.0
=> => # go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
=> => # go: downloading github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521184019-c5ad59b459ec
总是卡在这里。
下载时间很长,进而导致docker崩溃,
是否可以额外添加consul服务中心供选择?
下载本项目,将项目代码放置 gonivinck
配置 CODE_PATH_HOST
指定的本机目录,进入 golang
容器,运行项目代码。
redis-manange启动之后, 无法通过ip:2000的方式登录。
并且通过docker-compose logs -tf --tail=100 redis-manage
redis-manage_1 | 2022-11-27T13:44:39.832174818Z [Sun Nov 27 21:44:39 2022] 192.168.33.1:56422 Accepted
redis-manage_1 | 2022-11-27T13:44:39.832556366Z [Sun Nov 27 21:44:39 2022] 192.168.33.1:56423 Accepted
redis-manage_1 | 2022-11-27T13:44:39.836023829Z [Sun Nov 27 21:44:39 2022] 192.168.33.1:56422 [401]: GET /
redis-manage_1 | 2022-11-27T13:44:39.836254430Z [Sun Nov 27 21:44:39 2022] 192.168.33.1:56422 Closing
redis-manage_1 | 2022-11-27T13:45:25.842368530Z [Sun Nov 27 21:45:25 2022] 172.19.0.1:35722 Accepted
redis-manage_1 | 2022-11-27T13:45:25.843832423Z [Sun Nov 27 21:45:25 2022] 172.19.0.1:35722 [401]: GET /
redis-manage_1 | 2022-11-27T13:45:25.843843300Z [Sun Nov 27 21:45:25 2022] 172.19.0.1:35722 Closing
redis-manage_1 | 2022-11-27T13:45:29.735465533Z [Sun Nov 27 21:45:29 2022] 172.19.0.1:35762 Accepted
redis-manage_1 | 2022-11-27T13:45:29.737446536Z [Sun Nov 27 21:45:29 2022] 172.19.0.1:35762 [401]: GET /
redis-manage_1 | 2022-11-27T13:45:29.737464891Z [Sun Nov 27 21:45:29 2022] 172.19.0.1:35762 C
root@ff2413285d13:/usr/src/code/go-zero-mall# ./nivin install
bash: ./nivin: /bin/bash: bad interpreter: Permission denied
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.