当前位置: 首页 > news >正文

Dockerfile的使用

简介

制作docker镜像可以通过修改容器的方式,也通过通过Dockerfile文件的方式,下面通过Dockerfile文件的例子进行说明。

Dockerfile文件

FROM openjdk:8-alpine#ENV http_proxy http://127.0.0.1:7890
#ENV https_proxy http://127.0.0.1:7890#ENV TZ=Asia/Shanghai
#RUN set -eux; \
#    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
#    echo $TZ > /etc/timezone#RUN apk update \
#        && apk upgrade \ 
#        && apk add --no-cache bash \
#        bash-doc \
#        bash-completion \
#        && rm -rf /var/cache/apk/* \
#        && /bin/bash#RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories
RUN echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/"  > /etc/apk/repositories
RUN cat /etc/apk/repositories# 容器内执行
#$RUN rm -fr /var/cache/apk
#RUN mkdir -p mkdir /var/cache/apkRUN rm -rf /var/cache/apk/* && \rm -rf /tmp/*RUN apk updateENV TZ=Asia/Shanghai
RUN set -eux; \apk add --no-cache  tzdata; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  #RUN apk update \
#    && DEBIAN_FRONTEND=noninteractive apt install -y tzdata \
#    && rm -rf /var/lib/apt/lists/*RUN set -eux; \addgroup --gid 1000 java-app; \adduser -S -u 1000 -g java-app -h /home/java-app/ -s /bin/sh -D java-app;EXPOSE 8080COPY --chown=java-app firefly  /home/java-app/fireflyADD docker-entrypoint.sh /home/java-app/firefly/docker-entrypoint.shRUN chown -R java-app:java-app  /home/java-appUSER java-appWORKDIR /home/java-app/fireflyCMD /home/java-app/firefly/docker-entrypoint.sh

精简的Dockerfile文件

FROM openjdk:8-alpineRUN echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/"  > /etc/apk/repositories
RUN cat /etc/apk/repositoriesRUN rm -rf /var/cache/apk/* && \rm -rf /tmp/*RUN apk update -v
ENV TZ=Asia/Shanghai
RUN set -eux; \apk add --no-cache  tzdata; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  RUN set -eux; \addgroup --gid 1000 java-app; \adduser -S -u 1000 -g java-app -h /home/java-app/ -s /bin/sh -D java-app;EXPOSE 8080COPY --chown=java-app firefly  /home/java-app/fireflyADD docker-entrypoint.sh /home/java-app/firefly/docker-entrypoint.shRUN chown -R java-app:java-app  /home/java-appUSER java-appWORKDIR /home/java-app/fireflyCMD /home/java-app/firefly/docker-entrypoint.sh

制作镜像命令脚本

#!/bin/bashimage=harbor.k8s/firefly/firefly-spring-boot-starter:1.2.0#docker build -t $image  ./  --build-arg HTTP_PROXY="http://127.0.0.1:7890"  --no-cachedocker build -t $image  ./   --no-cache#--network=host
#docker build -t $image  ./   --progress=plain --no-cache
#docker push $image

基于elasticsearch基础镜像

elastisearch镜像是基于ubuntu制作的。

FROM elasticsearch:7.17.21RUN apt-get update
RUN apt-get install tzdataCOPY --chown=elasticsearch:elasticsearch jvm.options        /usr/share/elasticsearch/config/
COPY --chown=elasticsearch:elasticsearch elastic-certificates.p12        /usr/share/elasticsearch/config/
COPY --chown=elasticsearch:elasticsearch elastic-stack-ca.p12        /usr/share/elasticsearch/config/#COPY sysctl.conf  /etc/#RUN sysctl -w vm.max_map_count=262144ENV TZ=Asia/Shanghai
RUN set -eux; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone

基于filebeat的镜像

FROM docker.elastic.co/beats/filebeat:8.13.4USER root	ENV TZ=Asia/Shanghai
RUN apt-get update
RUN apt-get install tzdata
RUN set -eux; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  COPY filebeat-8.13.4-linux-x86_64/ilm.json  /usr/share/filebeat/ilm.json
COPY filebeat-8.13.4-linux-x86_64/template.json  /usr/share/filebeat/template.jsonRUN chown -R filebeat:filebeat  /usr/share/filebeatUSER filebeat

制作elasticsearch镜像

FROM elasticsearch:7.17.21RUN apt-get update
RUN apt-get install tzdataCOPY --chown=elasticsearch:elasticsearch jvm.options        /usr/share/elasticsearch/config/
COPY --chown=elasticsearch:elasticsearch elastic-certificates.p12        /usr/share/elasticsearch/config/
COPY --chown=elasticsearch:elasticsearch elastic-stack-ca.p12        /usr/share/elasticsearch/config/#COPY sysctl.conf  /etc/#RUN sysctl -w vm.max_map_count=262144ENV TZ=Asia/Shanghai
RUN set -eux; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone------------------------------------------------------
制作镜像命令
#!/bin/bashimage=harbor.k8s/firefly/elasticsearch:7.17.21#docker build -t $image  ./  --build-arg HTTP_PROXY="http://127.0.0.1:7890"  --no-cachedocker build -t $image  ./   --no-cache#--network=host
#docker build -t $image  ./   --progress=plain --no-cache
#docker push $image

制作filebeat镜像

基于filebeat官网镜像

FROM docker.elastic.co/beats/filebeat:8.13.4USER root	ENV TZ=Asia/Shanghai
RUN apt-get update
RUN apt-get install tzdata
RUN set -eux; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  COPY filebeat-8.13.4-linux-x86_64/ilm.json  /usr/share/filebeat/ilm.json
COPY filebeat-8.13.4-linux-x86_64/template.json  /usr/share/filebeat/template.jsonRUN chown -R filebeat:filebeat  /usr/share/filebeatUSER filebeat

基于alpine:3.9.5

#FROM openjdk:8-alpine
#FROM hub-dev.paas.jnbank.com.cn/jiangnanbank/kylin-server-tini-jdk:openjdk1.8.0.272
#FROM centos:7 FROM alpine:3.9.5RUN echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/"  > /etc/apk/repositories
RUN cat /etc/apk/repositoriesRUN rm -rf /var/cache/apk/* && \rm -rf /tmp/*
RUN apk update -v	
ENV TZ=Asia/Shanghai
RUN set -eux; \apk add --no-cache  tzdata; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  RUN set -eux; \addgroup --gid 1000 filebeat; \adduser -S -u 1000 -g filebeat -h /usr/share/filebeat -s /bin/sh -D filebeat;RUN mkdir /lib64
RUN ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2   RUN apk add musl-dev
RUN ln -s /usr/lib/libc.so /usr/lib/libresolv.so.2#USER root
#RUN useradd -m filebeat -d /usr/share/filebeatCOPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +rx /usr/local/bin/docker-entrypoint.shCOPY --chown=filebeat:filebeat filebeat-8.13.4-linux-x86_64/  /usr/share/filebeat/USER filebeat  
WORKDIR /usr/share/filebeat 
ENV PATH=/usr/share/filebeat:/usr/local/bin/:$PATH
#ENTRYPOINT ["docker-entrypoint.sh", "-e", "-strict.perms=false"]

基于centos:7 镜像

#FROM openjdk:8-alpine
#FROM hub-dev.paas.jnbank.com.cn/jiangnanbank/kylin-server-tini-jdk:openjdk1.8.0.272
FROM centos:7 #RUN set -eux; \
#    addgroup --gid 1000 filebeat; \
#    adduser -S -u 1000 -g filebeat -h /usr/share/filebeat -s /bin/sh -D filebeat;USER rootRUN yum install -y tzdataRUN useradd -m filebeat -d /usr/share/filebeatCOPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +rx /usr/local/bin/docker-entrypoint.shCOPY --chown=filebeat:filebeat filebeat-8.13.4-linux-x86_64/  /usr/share/filebeat/USER filebeat  
WORKDIR /usr/share/filebeat 
ENV PATH=/usr/share/filebeat:/usr/local/bin/:$PATH
#ENTRYPOINT ["docker-entrypoint.sh", "-e", "-strict.perms=false"]

基于filebeat官方镜像

FROM docker.elastic.co/beats/filebeat:8.13.4COPY filebeat-8.13.4-linux-x86_64/ilm.json  /usr/share/filebeat/ilm.json
COPY filebeat-8.13.4-linux-x86_64/template.json  /usr/share/filebeat/template.json

docker-entrypoint.sh文件

#!/bin/shset -euo pipefailif [ "$#" = 0 ];then exec filebeat "$@"
fi if [[ -z $1 ]] || [[ ${1:0:1} == '-' ]] ; thenexec filebeat "$@"
elsesubcommands=$(filebeat help \| awk 'BEGIN {RS=""; FS="\n"} /Available Commands:/' \| awk '/^\s+/ {print $1}')for subcommand in $subcommands; doif [[ $1 == $subcommand ]]; thenexec filebeat "$@"fidone
fiexec "$@"

制作镜像脚本

#!/bin/bashimage=harbor.k8s/firefly/filebeat:8.13.4  #docker build -t $image  ./  --build-arg HTTP_PROXY="http://127.0.0.1:7890"  --no-cachedocker build -t $image  ./   --no-cache#--network=host
#docker build -t $image  ./   --progress=plain --no-cache
#docker push $image

制作firefly镜像

Dockerfile文件

FROM openjdk:8-alpineRUN echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/"  > /etc/apk/repositories
RUN cat /etc/apk/repositoriesRUN rm -rf /var/cache/apk/* && \rm -rf /tmp/*RUN apk update -v
ENV TZ=Asia/Shanghai
RUN set -eux; \apk add --no-cache  tzdata; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  RUN set -eux; \addgroup --gid 1000 java-app; \adduser -S -u 1000 -g java-app -h /home/java-app/ -s /bin/sh -D java-app;EXPOSE 8080COPY --chown=java-app firefly  /home/java-app/fireflyADD docker-entrypoint.sh /home/java-app/firefly/docker-entrypoint.shRUN chown -R java-app:java-app  /home/java-appUSER java-appWORKDIR /home/java-app/fireflyCMD /home/java-app/firefly/docker-entrypoint.sh

docker-entrypoint.sh文件

sh /home/java-app/firefly/firefly.sh start

镜像脚本

#!/bin/bashimage=harbor.k8s/firefly/firefly-spring-boot-starter:1.2.0#docker build -t $image  ./  --build-arg HTTP_PROXY="http://127.0.0.1:7890"  --no-cachedocker build -t $image  ./   --no-cache#--network=host
#docker build -t $image  ./   --progress=plain --no-cache
#docker push $image

制作nginx镜像

Dockerfile文件

FROM nginx:latest# 删除默认的nginx.conf文件
# RUN rm /etc/nginx/nginx.conf# 将本地的nginx.conf文件复制到容器中
COPY nginx.conf /etc/nginx/
# 复制dist目录到容器中
COPY dist/ /www/# 暴露8088端口
EXPOSE 8088# 启动Nginx服务器
CMD ["nginx", "-g", "daemon off;"]

nginx.conf文件


# user agree  agree;
worker_processes  1;#error_log  logs/error.log error;
#error_log  logs/notice.log  notice;
#error_log  logs/info.log  info;pid        nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       8888;#server_name  10.8.4.118;#charset koi8-r;#access_log  logs/host.access.log  main;##error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}location /stub_status {stub_status on;access_log off;}location  / {root /www/;index index.html;try_files $uri $uri/ /index.html;add_header Access-Control-Allow-Origin *;add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';if ($request_method = 'OPTIONS') {return 204;}if ($request_filename ~* .*\.(?:htm|html)$) {add_header Cache-Control 'no-cache';add_header Access-Control-Allow-Origin *;}}location /favicon.ico {root /www/;}location /gw/firefly/ {proxy_set_header X-Real-IP $remote_addr;proxy_set_header Host $http_host;proxy_set_header Cookie $http_cookie;# proxy_set_header X-Real_IP $remote_addr;proxy_set_header X_Forwarded-For $proxy_add_x_forwarded_for;proxy_http_version 1.1;proxy_set_header X-Client-IP $remote_addr;proxy_read_timeout 300s;proxy_cookie_path /firefly /;rewrite ^/gw/firefly/(.*) /firefly/$1 break;proxy_pass http://10.8.4.118:8080;}#     # proxy the PHP scripts to Apache listening on 127.0.0.1:80#     ##     #location ~ \.php$ {#     #    proxy_pass   http://127.0.0.1;#     #}#     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000#     ##     #location ~ \.php$ {#     #    root           html;#     #    fastcgi_pass   127.0.0.1:9000;#     #    fastcgi_index  index.php;#     #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#     #    include        fastcgi_params;#     #}#     # deny access to .htaccess files, if Apache's document root#     # concurs with nginx's one#     ##     #location ~ /\.ht {#     #    deny  all;#     #}}#server {#listen       8881;#server_name  10.8.4.118;#charset koi8-r;#access_log  logs/host.access.log  main;##error_page  404              /404.html;# redirect server error pages to the static page /50x.html##error_page   500 502 503 504  /50x.html;#location = /50x.html {#    root   html;#}# location /stub_status {#    stub_status on;#   access_log off;#}# location  / {#     root /firefly-afa/;#     index index.html;#     try_files $uri $uri/ /index.html;#     add_header Access-Control-Allow-Origin *;#        add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';#        add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';#   if ($request_method = 'OPTIONS') {#      return 204;# }# if ($request_filename ~* .*\.(?:htm|html)$) {#     add_header Cache-Control 'no-cache';#     add_header Access-Control-Allow-Origin *;# }#}#location /favicon.ico {#   root /firefly-afa/;#}#location /firefly-gateway/ {#           rewrite ^/firefly-gateway/(.*) /firefly/$1 break;#          proxy_pass http://10.8.4.118:8901;#}#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}

命令脚本

#!/bin/bashimage=nginx-firefly:latest-1.2.0docker build -t $image  ./  --no-cache#docker build -t $image  ./   --progress=plain --no-cache#docker push $image

制作skywalking oap镜像

Dockerfile文件

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.ARG JAVA_VERSION=8FROM adoptopenjdk/openjdk$JAVA_VERSION:alpineRUN echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/"  > /etc/apk/repositories
RUN cat /etc/apk/repositoriesRUN rm -rf /var/cache/apk/* && \rm -rf /tmp/*RUN apk update -v
ENV TZ=Asia/Shanghai
RUN set -eux; \apk add --no-cache  tzdata; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezone  ENV JAVA_OPTS=" -Xms256M " \SW_CLUSTER="standalone" \SW_STORAGE="h2"ARG DIST_NAME
ENV DIST_NAME="apache-skywalking-apm-bin"
COPY "$DIST_NAME.tar.gz" /RUN set -ex; \tar -xzf "$DIST_NAME.tar.gz"; \rm -rf "$DIST_NAME.tar.gz"; \mv "$DIST_NAME" skywalking;WORKDIR skywalking#COPY log4j2.xml config/
COPY docker-entrypoint.sh .
RUN mkdir ext-config; \mkdir ext-libs;EXPOSE 12800 11800 1234ENTRYPOINT ["sh", "docker-entrypoint.sh"]

docker-entrypoint.sh文件

#censed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License./skywalking/bin/oapService-foreground.sh "$@"

docker-entrypoint.sh文件(版本2)

#censed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.set -eecho "[Entrypoint] Apache SkyWalking Docker Image"EXT_LIB_DIR=/skywalking/ext-libs
EXT_CONFIG_DIR=/skywalking/ext-config# Override configuration files
if [ "$(ls -A $EXT_CONFIG_DIR)" ]; thencp -vfRL ${EXT_CONFIG_DIR}/* config/
fiCLASSPATH="config:$CLASSPATH"
for i in oap-libs/*.jar
doCLASSPATH="$i:$CLASSPATH"
done
for i in "${EXT_LIB_DIR}"/*.jar
doCLASSPATH="$i:$CLASSPATH"
doneif java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -version; thenJAVA_OPTS="${JAVA_OPTS} -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
fiset -exexec java ${JAVA_OPTS} -classpath ${CLASSPATH} org.apache.skywalking.oap.server.starter.OAPServerStartUp "$@"

日志输出

默认输出到文件,官方版本默认输出到终端。如果想在文件和终端同时输出,修改日志配置文件conf/log4j2.xml

加上配置

<Console name="Console" target="SYSTEM_OUT"><PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
</Console>
以及
<AppenderRef ref="Console"/>

完整的配置内容为:

<?xml version="1.0" encoding="UTF-8"?>
<!--~ Licensed to the Apache Software Foundation (ASF) under one or more~ contributor license agreements.  See the NOTICE file distributed with~ this work for additional information regarding copyright ownership.~ The ASF licenses this file to You under the Apache License, Version 2.0~ (the "License"); you may not use this file except in compliance with~ the License.  You may obtain a copy of the License at~~     http://www.apache.org/licenses/LICENSE-2.0~~ Unless required by applicable law or agreed to in writing, software~ distributed under the License is distributed on an "AS IS" BASIS,~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.~ See the License for the specific language governing permissions and~ limitations under the License.~--><Configuration status="info"><Properties><Property name="log-path">${sys:oap.logDir}</Property></Properties><Appenders><RollingFile name="RollingFile" fileName="${log-path}/skywalking-oap-server.log"filePattern="${log-path}/skywalking-oap-server-%d{yyyy-MM-dd}-%i.log.gz"><PatternLayout><pattern>%d - %c - %L [%t] %-5p %x - %m%n</pattern></PatternLayout><Policies><SizeBasedTriggeringPolicy size="102400KB"/></Policies><DefaultRolloverStrategy max="7"><Delete basePath="${log-path}" maxDepth="1"><IfFileName glob="*.log.gz"/><IfLastModified age="7d" /></Delete></DefaultRolloverStrategy></RollingFile><Console name="Console" target="SYSTEM_OUT"><PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/></Console></Appenders><Loggers><logger name="org.eclipse.jetty" level="INFO"/><logger name="org.apache.zookeeper" level="INFO"/><logger name="io.grpc.netty" level="INFO"/><Root level="info"><AppenderRef ref="RollingFile"/><AppenderRef ref="Console"/></Root></Loggers>
</Configuration>

制作asuperagent镜像

Dockerfile文件

FROM alpine:3.9.5ENV TZ=Asia/Shanghai
RUN set -eux; \ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \echo $TZ > /etc/timezoneRUN set -eux; \addgroup --gid 1000 agent-app  ; \adduser -S -u 1000 -g agent-app   -h /home/agent-app/ -s /bin/sh -D agent-app;RUN mkdir /lib64
RUN ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2     WORKDIR /home/agent-app  
EXPOSE 8972ADD docker-entrypoint.sh /home/agent-app/docker-entrypoint.shCOPY asuperagent    /home/agent-app/asuperagent
COPY config.yaml    /home/agent-app/config.yamlCMD /home/agent-app/docker-entrypoint.sh

docker-entrypoint.sh文件

/home/agent-app/asuperagent /home/agent-app/config.yaml

镜像脚本

#!/bin/bashimage=harbor.k8s/agree/ada/asuperagent:1.0.0
docker build -t $image  ./
docker push $image

相关文章:

Dockerfile的使用

简介 制作docker镜像可以通过修改容器的方式&#xff0c;也通过通过Dockerfile文件的方式&#xff0c;下面通过Dockerfile文件的例子进行说明。 Dockerfile文件 FROM openjdk:8-alpine#ENV http_proxy http://127.0.0.1:7890 #ENV https_proxy http://127.0.0.1:7890#ENV TZ…...

自動換IP為什麼會不穩定?

自動換IP可能導致不穩定的原因有以下幾點&#xff1a; 1. 連接中斷 自動換IP的一個直接後果就是連接中斷。每當IP地址發生變化時&#xff0c;網路連接可能會短暫中斷。這就像你在搬家時&#xff0c;暫時無法接收郵件一樣。對於需要持續連接的任務&#xff0c;比如視頻會議或線…...

【0x0043】HCI_Write_Inquiry_Scan_Type详解

目录 一、命令概述 二、命令格式及参数说明 2.1. HCI_Write_Inquiry_Scan_Type命令格式 2.2. Scan_Type 2.3.具体格式示例 三、响应事件及参数说明 3.1. HCI_Command_Complete事件 3.2. Status 四、命令执行流程 4.1. 命令准备阶段 4.2. 命令传输阶段 4.3. 命令处理…...

飞牛云fnOS本地部署WordPress个人网站并一键发布公网远程访问

文章目录 前言1. Docker下载源设置2. Docker下载WordPress3. Docker部署Mysql数据库4. WordPress 参数设置5. 飞牛云安装Cpolar工具6. 固定Cpolar公网地址7. 修改WordPress配置文件8. 公网域名访问WordPress 前言 本文旨在详细介绍如何在飞牛云NAS上利用Docker部署WordPress&a…...

ctfshow-web入门-SSTI(web361-web368)上

目录 1、web361 2、web362 3、web363 4、web364 5、web365 6、web366 7、web367 8、web368 1、web361 测试一下存在 SSTI 注入 方法很多 &#xff08;1&#xff09;使用子类可以直接调用的函数来打 payload1&#xff1a; ?name{{.__class__.__base__.__subclasses__…...

pyinstaller+upx给python GUI程序添加自定义图标

一、在线.ico图标生成 windows用48x48尺寸 https://www.ico51.cn/ 二、upx打包图标工具 https://upx.github.io/ 三、UI文件生成py代码 pyside2-uic window.ui > window.py 四、打包命令 1、–icon&#xff1a;这个是.ico图标路径 2、–upx-dir&#xff1a;upx打包工…...

LeetCode【0034】在排序数组中查找元素的第一个和最后一个位置

本文目录 1 中文题目2 求解方法&#xff1a;左右边界二分查找2.1 方法思路2.2 Python代码2.3 复杂度分析 3 题目总结 1 中文题目 给定一个按照非递减顺序排列的整数数组 nums&#xff0c;和一个目标值 target。请找出给定目标值在数组中的开始位置和结束位置。 如果数组中不存…...

react-markdown内容宽度溢出和换行不生效问题

情景复现&#xff1a; 解决办法&#xff0c;添加样式进行限制 /* index.css */ .markdown-container {word-break: break-word; /* 强制长单词断行 */white-space: pre-wrap; /* 保留空白符序列&#xff0c;但是正常地进行换行 */overflow-wrap: break-word; /* 在长单词或…...

uniapp 上传 base64 图片

在图片裁剪时候返回的是base64文件 需要上传到obs一般出现在h5网页端 可以直接使用 js 原始解决 应该只可以在h5浏览器内使用 // 提取 Base64 编码部分 const base64Data e.tempFilePath.replace(/^data:image\/(\w);base64,/, ""); // 将 Base64 编码转换为 Arra…...

让Git走代理

有时候idea提交代码或者从github拉取代码&#xff0c;一直报错超时或者:Recv failure: Connection was reset,下面记录一下怎么让git走代理从而访问到github。 1.打开梯子 2.打开网络和Internet设置 3.设置代理 记住这个地址和端口 4.打开git bash终端 输入以下内容 git c…...

通义千问API调用测试 (colab-python,vue)

文章目录 代码&#xff08;来自官网&#xff09;colab中用python测试Qwen2.5在官网上查看并确定过期时间这里看到我的免费额度到25年5月在同一个页面&#xff0c;点击API示例 前端调用直接在前端调用的优缺点以vue为例&#xff08;代码是基于官网node.js的代码转换而来&#xf…...

H3C ER8300G2-X未授权导致信息泄露漏洞(CVE-2024-32238)

免责声明: 本文旨在提供有关特定漏洞的深入信息,帮助用户充分了解潜在的安全风险。发布此信息的目的在于提升网络安全意识和推动技术进步,未经授权访问系统、网络或应用程序,可能会导致法律责任或严重后果。因此,作者不对读者基于本文内容所采取的任何行为承担责任。读者在…...

随手记:简单实现纯前端文件导出(XLSX)

1.需求背景&#xff1a; 由于导入需要经过后端存储数据库&#xff0c;所以导入还是和后端联调 但是简单的前端导出有部分是可以直接给到用户 xlsx插件简介 xlsx插件&#xff08;通常指的是SheetJS/js-xlsx&#xff09;是一个强大的JavaScript库&#xff0c;它允许你在浏览器…...

SwiftUI 高级开发教程系列 - 第 3 章:数据持久化

在现代应用中,数据持久化是一项非常重要的功能,它使得应用的数据可以在重启后依然保留,提升用户体验。SwiftUI 提供了多种数据持久化方法,包括使用 UserDefaults 保存简单数据和 Core Data 进行更复杂的数据管理。本章将详细讲解这两种技术的用法,并展示如何在 SwiftUI 项…...

代码随想录第二十四天| 93.复原IP地址 78.子集 90.子集II

93. 复原IP地址 题目描述 给定一个只包含数字的字符串 s&#xff0c;复原它并返回所有可能的有效 IP 地址格式。 一个有效的 IP 地址 由四个整数部分组成&#xff0c;每部分的取值范围是 0-255&#xff0c;每个部分不能包含前导零。 解题思路 这道题目要求我们将一个数字字…...

Linux编程:基于 Unix Domain Socket 的进程/线程间通信实时性优化

文章目录 0. 引言1. 使用 epoll 边缘触发模式非不要不选择阻塞模式边缘触发&#xff08;ET&#xff09;模式优点示例 2. 使用实时调度策略3. CPU 绑定4. 使用无锁缓冲区5. 优化消息传递的大小和频率6. 使用 SO_RCVTIMEO 和 SO_SNDTIMEO7. 示例代码其他阅读 0. 引言 前几天被问…...

PET-文件包含-FINISHED

include发生错误报warning&#xff0c;继续执行。require发生错误直接error&#xff0c;不继续执行 无视扩展名&#xff0c;只要能解析&#xff0c;就能当可执行文件执行&#xff0c;哪怕文件后缀或没后缀 1 条件竞争 pass17 只需要知道tmp的路径。把xieshell.jpg上传&…...

《WebGL编程指南》书籍分享

在这个数字化时代&#xff0c;WebGL作为一门前沿的图形渲染技术&#xff0c;为网页带来了前所未有的交互体验。今天&#xff0c;我很荣幸向大家分享一本关于学习WebGL的书籍——《Webgl编程指南》 电子版下载链接: https://pan.baidu.com/s/1eTX2Y5ynYH0pUQRf0Jcbow?...

go T 泛型

目录 1、类型约束 2、泛型函数 3、泛型结构体 4、泛型接口 5、以接口作为类型约束 关键词&#xff1a;泛型、类型参数、类型约束 Go 语言在 1.18 版本引入了泛型&#xff08;Generics&#xff09;特性&#xff0c;可以编写更通用、可复用的代码&#xff0c;泛型可以用于&a…...

React的基础API介绍(二)

目录 useStateuseState 的基本原理1. 状态在函数组件中的引入2. useState 的工作机制3. Hook 状态与组件渲染 useState 的使用方法1. 基本用法2. 多个状态变量3. 更新状态 注意事项与最佳实践1. 状态更新可能是异步的2. 不要直接修改状态3. 更新对象或数组状态4. 避免闭包陷阱 …...

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

汽车生产虚拟实训中的技能提升与生产优化​

在制造业蓬勃发展的大背景下&#xff0c;虚拟教学实训宛如一颗璀璨的新星&#xff0c;正发挥着不可或缺且日益凸显的关键作用&#xff0c;源源不断地为企业的稳健前行与创新发展注入磅礴强大的动力。就以汽车制造企业这一极具代表性的行业主体为例&#xff0c;汽车生产线上各类…...

OkHttp 中实现断点续传 demo

在 OkHttp 中实现断点续传主要通过以下步骤完成&#xff0c;核心是利用 HTTP 协议的 Range 请求头指定下载范围&#xff1a; 实现原理 Range 请求头&#xff1a;向服务器请求文件的特定字节范围&#xff08;如 Range: bytes1024-&#xff09; 本地文件记录&#xff1a;保存已…...

ESP32 I2S音频总线学习笔记(四): INMP441采集音频并实时播放

简介 前面两期文章我们介绍了I2S的读取和写入&#xff0c;一个是通过INMP441麦克风模块采集音频&#xff0c;一个是通过PCM5102A模块播放音频&#xff0c;那如果我们将两者结合起来&#xff0c;将麦克风采集到的音频通过PCM5102A播放&#xff0c;是不是就可以做一个扩音器了呢…...

BCS 2025|百度副总裁陈洋:智能体在安全领域的应用实践

6月5日&#xff0c;2025全球数字经济大会数字安全主论坛暨北京网络安全大会在国家会议中心隆重开幕。百度副总裁陈洋受邀出席&#xff0c;并作《智能体在安全领域的应用实践》主题演讲&#xff0c;分享了在智能体在安全领域的突破性实践。他指出&#xff0c;百度通过将安全能力…...

管理学院权限管理系统开发总结

文章目录 &#x1f393; 管理学院权限管理系统开发总结 - 现代化Web应用实践之路&#x1f4dd; 项目概述&#x1f3d7;️ 技术架构设计后端技术栈前端技术栈 &#x1f4a1; 核心功能特性1. 用户管理模块2. 权限管理系统3. 统计报表功能4. 用户体验优化 &#x1f5c4;️ 数据库设…...

短视频矩阵系统文案创作功能开发实践,定制化开发

在短视频行业迅猛发展的当下&#xff0c;企业和个人创作者为了扩大影响力、提升传播效果&#xff0c;纷纷采用短视频矩阵运营策略&#xff0c;同时管理多个平台、多个账号的内容发布。然而&#xff0c;频繁的文案创作需求让运营者疲于应对&#xff0c;如何高效产出高质量文案成…...

【Nginx】使用 Nginx+Lua 实现基于 IP 的访问频率限制

使用 NginxLua 实现基于 IP 的访问频率限制 在高并发场景下&#xff0c;限制某个 IP 的访问频率是非常重要的&#xff0c;可以有效防止恶意攻击或错误配置导致的服务宕机。以下是一个详细的实现方案&#xff0c;使用 Nginx 和 Lua 脚本结合 Redis 来实现基于 IP 的访问频率限制…...

C语言中提供的第三方库之哈希表实现

一. 简介 前面一篇文章简单学习了C语言中第三方库&#xff08;uthash库&#xff09;提供对哈希表的操作&#xff0c;文章如下&#xff1a; C语言中提供的第三方库uthash常用接口-CSDN博客 本文简单学习一下第三方库 uthash库对哈希表的操作。 二. uthash库哈希表操作示例 u…...

水泥厂自动化升级利器:Devicenet转Modbus rtu协议转换网关

在水泥厂的生产流程中&#xff0c;工业自动化网关起着至关重要的作用&#xff0c;尤其是JH-DVN-RTU疆鸿智能Devicenet转Modbus rtu协议转换网关&#xff0c;为水泥厂实现高效生产与精准控制提供了有力支持。 水泥厂设备众多&#xff0c;其中不少设备采用Devicenet协议。Devicen…...