Code Monkey home page Code Monkey logo

images's Introduction

images

自定义镜像合集,整合容器环境使用的镜像和构建脚本

1. 镜像目录

1.1 系统

1.2 开发环境

1.3 代理工具

1.4 AI

2. 备忘录

2.1 Makefile

  • make image: 默认使用docker和本机架构构建镜像
  • make release: 默认使用buildkit构建镜像,默认构建linux/amd64与linux/arm64两种架构(若应用支持)
  • make all: 构建多个release版本

2.2 Docker

文档链接:Dockerfile reference

创建buildx构建实例

docker buildx create --use --name multiarch --platform linux/amd64,linux/arm64

多架构变量

  • TARGETPLATFORM: 目标镜像的平台,例如linux/amd64,linux/arm/v7, windows/amd64
  • TARGETOS: TARGETPLATFORM 的操作系统部分,如linux,windows
  • TARGETARCH: TARGETPLATFORM 的架构部分,如amd64,arm64
  • TARGETVARIANT: TARGETPLATFORM 的变体组件,如v7
  • BUILDPLATFORM: 执行构建的节点平台
  • BUILDOS: BUILDPLATFORM 的操作系统组件
  • BUILDARCH: BUILDPLATFORM 的架构组件
  • BUILDVARIANT: BUILDPLATFORM 的变体组件

2.3 交叉编译

buildkitd使用qemu来模拟目标架构执行多架构编译,但是运行效率很低,若编译工具支持交叉编译,可以使用本机架构完成编译,然后将编译出的二进制文件拷贝到目标架构的基础镜像中制作镜像,以go语言为例,如下:

# buildkit跨架构编译缓慢,统一使用本机架构进行交叉编译
FROM --platform=$BUILDPLATFORM wbuntu/golang:1.19 AS builder
ARG TARGETARCH
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=$TARGETARCH
WORKDIR /custom-service
COPY . /custom-service
RUN make build
# 编译完成后拷贝到目标架构的基础镜像中
FROM --platform=$TARGETPLATFORM wbuntu/alpine:3.15
COPY --from=builder /custom-service/custom-service /usr/bin/custom-service
CMD ["/usr/bin/custom-service","-c","/etc/custom-service/config.toml"]

images's People

Contributors

wbuntu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

images's Issues

ip要是美国的?

chatgpt-next-web-1 | [Server Config] using 1 of 1 api key
chatgpt-next-web-1 | [Auth] use system api key
chatgpt-next-web-1 | [Proxy] v1/chat/completions?path=v1&path=chat&path=completions
chatgpt-next-web-1 | [Base Url] http://backend:8000
backend-1 | model='gpt-3.5-turbo' messages=[ChatMessage(role='system', content='\nYou are ChatGPT, a large language model trained by OpenAI.\nKnowledge cutoff: 2021-09\nCurrent model: gpt-3.5-turbo\nCurrent time: 2024/4/8 21:44:46\nLatex inline: $x^2$ \nLatex block: $$e=mc^2$$\n\n'), ChatMessage(role='user', content='我想让你担任机器学习工程师。我会写一些机器学习的概念,你的工作就是用通俗易懂的术语来解释它们。这可能包括提供构建模型的分步说明、给出所用的技术或者理论、提供评估函数等。我的问题是'), ChatMessage(role='user', content='hi')] temperature=1.0 top_p=1.0 max_length=None stream=True
backend-1 | INFO: 172.31.0.5:50498 - "POST /v1/chat/completions?path=v1&path=chat&path=completions HTTP/1.1" 200 OK
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.wikipedia: engine timeout
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.wikidata: engine timeout
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.duckduckgo: engine timeout
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.google: engine timeout
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.qwant: engine timeout
searxng-1 | 2024-04-08 13:44:45,093 ERROR:searx.engines.brave: engine timeout
freegpt35-1 | Request: POST /v1/chat/completions 1 messages (stream-enabled)
searxng-1 | 2024-04-08 13:44:45,225 WARNING:searx.engines.wikipedia: ErrorContext('searx/search/processors/online.py', 116, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'en.wikipedia.org')) False
searxng-1 | 2024-04-08 13:44:45,225 ERROR:searx.engines.wikipedia: HTTP requests timeout (search duration : 3.1328373439610004 s, timeout: 3.0 s) : ConnectTimeout
searxng-1 | 2024-04-08 13:44:45,228 WARNING:searx.engines.brave: ErrorContext('searx/search/processors/online.py', 116, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'search.brave.com')) False
searxng-1 | 2024-04-08 13:44:45,228 ERROR:searx.engines.brave: HTTP requests timeout (search duration : 3.135313393548131 s, timeout: 3.0 s) : ConnectTimeout
searxng-1 | 2024-04-08 13:44:45,229 WARNING:searx.engines.duckduckgo: ErrorContext('searx/engines/duckduckgo.py', 118, 'res = get(query_url)', 'httpx.ConnectTimeout', None, (None, None, 'duckduckgo.com')) False
searxng-1 | 2024-04-08 13:44:45,230 WARNING:searx.engines.qwant: ErrorContext('searx/search/processors/online.py', 116, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'api.qwant.com')) False
searxng-1 | 2024-04-08 13:44:45,230 ERROR:searx.engines.duckduckgo: HTTP requests timeout (search duration : 3.137855425477028 s, timeout: 3.0 s) : ConnectTimeout
searxng-1 | 2024-04-08 13:44:45,231 ERROR:searx.engines.qwant: HTTP requests timeout (search duration : 3.13800535351038 s, timeout: 3.0 s) : ConnectTimeout
searxng-1 | 2024-04-08 13:44:45,231 WARNING:searx.engines.google: ErrorContext('searx/search/processors/online.py', 116, "response = req(params['url'], **request_args)",'httpx.ConnectTimeout', None, (None, None, 'www.google.com')) False
searxng-1 | 2024-04-08 13:44:45,231 ERROR:searx.engines.google: HTTP requests timeout (search duration : 3.138699973002076 s, timeout: 3.0 s) : ConnectTimeout
searxng-1 | 2024-04-08 13:44:45,294 WARNING:searx.engines.wikidata: ErrorContext('searx/search/processors/online.py', 116, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'query.wikidata.org')) False
searxng-1 | 2024-04-08 13:44:45,294 ERROR:searx.engines.wikidata: HTTP requests timeout (search duration : 3.2015139684081078 s, timeout: 3.0 s) : ConnectTimeout
freegpt35-1 | Error refreshing session ID, retrying in 1 minute...
freegpt35-1 | If this error persists, your country may not be supported yet.
freegpt35-1 | If your country was the issue, please consider using a U.S. VPN.
freegpt35-1 | Error refreshing session ID, retrying in 1 minute...
freegpt35-1 | If this error persists, your country may not be supported yet.
freegpt35-1 | If your country was the issue, please consider using a U.S. VPN.

无法更改端口

docker run -d --name free-ask-internet -p 3000:3000 --add-host=freegpt35:127.0.0.1 --add-host=backend:127.0.0.1 --add-host=searxng:127.0.0.1 wbuntu/free-ask-internet:v0.0.1

部署后,还是会监听在3000,可能代码里有个地方没有改

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.