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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/471239.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Elasticsearch基本概念及使用

Elasticsearch 是一个开源的、分布式的全文搜索和分析引擎&#xff0c;基于 Apache Lucene 构建。它提供了快速的搜索能力&#xff0c;支持大规模的数据分析&#xff0c;广泛应用于日志分析、全文搜索、监控系统和商业智能等领域。ES操作指令是基于restAPI构建&#xff0c;也就…

Vue.js 项目创建流程

Vue.js 项目创建流程 以下是一个详细的步骤指南&#xff0c;用于在Windows系统上使用NVM&#xff08;Node Version Manager&#xff09;和npm创建一个新的Vue.js项目。 1. 安装Node.js指定版本 首先&#xff0c;使用NVM安装Node.js的20.18.0版本。 nvm install 20输出示例&…

如何判定linux系统CPU的核心架构

背景 在开发一个项目的时候&#xff0c;需要配置安装PyTorch环境&#xff0c;自己电脑以前下载过这个相关的包&#xff0c;但是是X86架构的&#xff0c;不知道复制到Linux系统后能否直接使用&#xff0c;于是想着去确认一下&#xff0c;并把自己的方法总结一下,自己下载的文件…

Vue2:组件

Vue2&#xff1a;组件 非单文件组件定义注册使用 单文件组件 组件是Vue中最核心的内容&#xff0c;在编写页面时&#xff0c;将整个页面视为一个个组件&#xff0c;再把组件拼接起来&#xff0c;这样每个组件之间相互独立&#xff0c;有自己的结构样式&#xff0c;使页面编写思…

408模拟卷较难题(无分类)

模拟卷特别是大题还是很有难度的&#xff0c;而且有些题有错&#xff0c;还是先把真题吃透&#xff0c;后面没时间的话就不整理了。 一棵树转化为二叉树&#xff0c;那么这棵二叉树一定为右子树为空的树 计算不同种形态&#xff0c;即计算6个结点的二叉树有几种形态&#xff0c…

(六)Spark大数据开发实战:豆瓣电影数据处理与分析(scala版)

目录 一、Spark 二、数据介绍 三、Spark大数据开发实战(Scala) 1、数据文件上传HDFS 2、导入模块及数据 3、数据统计与分析 ①、计算演员参演电影数 ②、依次罗列电影番位前十的演员 ③、按照番位计算演员参演电影数 ④、求每位演员所有参演电影中的最早、最晚上映…

SpringMVC学习笔记(二)

五、Rest风格编程 &#xff08;一&#xff09;Rest风格URL规范介绍 1、什么是restful RESTful架构&#xff0c;就是目前最流行的一种互联网软件架构风格。它结构清晰、符合标准、易于理解、扩展方便&#xff0c;所以正得到越来越多网站的采用。REST这个词&#xff0c;是Roy T…

PyTorch深度学习与企业级项目实战-预训练语言模型GPT

【图书推荐】《PyTorch深度学习与企业级项目实战》-CSDN博客 13个PyTorch深度学习案例简介-CSDN博客 《PyTorch深度学习与企业级项目实战&#xff08;人工智能技术丛书&#xff09;》(宋立桓&#xff0c;宋立林)【摘要 书评 试读】- 京东图书 (jd.com) PyTorch深度学习算法与…

CTF攻防世界小白刷题自学笔记13

1.fileinclude,难度&#xff1a;1,方向&#xff1a;Web 题目来源:宜兴网信办 题目描述:无 给一下题目链接&#xff1a;攻防世界Web方向新手模式第16题。 打开一看给了很多提示&#xff0c;什么language在index.php的第九行&#xff0c;flag在flag.php中&#xff0c;但事情显…

【QT常用技术讲解】优化网络链接不上导致qt、qml界面卡顿的问题

前言 qt、qml项目经常会涉及访问MySQL数据库、网络服务器&#xff0c;并且界面打开时的初始化过程就会涉及到链接Mysql、网络服务器获取数据&#xff0c;如果网络不通&#xff0c;卡个几十秒&#xff0c;会让用户觉得非常的不爽&#xff0c;本文从技术调研的角度讲解解决此类问…

基于OpenCV的自制Python访客识别程序

这是我用Pyqt5&#xff0c;基于OpenCV做的一个Python访客识别程序&#xff0c;它具体包括如下5个功能&#xff1a; 1、选择媒体菜单&#xff0c;可以打开本地摄像头&#xff1b;如果知道rtsp地址&#xff0c;则可以直接访问局域网内的网络串流。 2、选择播放菜单&#xff0c;…

SQL集合运算

集合论是SQL语言的根基。 1 集合运算 注意事项&#xff1a; 1&#xff09;SQL能操作具有重复行的集合&#xff0c;可以通过可选项ALL来支持。 如果直接使用UNION或INTERSECT&#xff0c;结果里不会出现重复的行。如果想在结果里留下重复行&#xff0c;可以加上可选项ALL。写…

Gartner发布安全平台创新洞察:安全平台需具备的11项常见服务

安全和风险管理领导者的任务是管理多个安全供应商和复杂的基础设施堆栈。本研究提供了有关安全平台优势和风险的见解&#xff0c;并提供了为组织选择合适平台的建议。 主要发现 自适应和行为安全防御需要跨安全基础设施组件进行更多的协调&#xff0c;而目前孤立的异构供应商架…

基于海思soc的智能产品开发(两个图像处理来源)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 对于图像&#xff0c;大家能够想到的一般就是sensor&#xff0c;也就是摄像头。其实对于图像来说&#xff0c;还有另外一个来源&#xff0c;那就是…

如何使用 Web Scraper API 高效采集 Facebook 用户帖子信息

目录 前言一、什么是Web Scraper API二、Web Scraper API 的优势&#xff1a;三、Web Scraper API 适用场景四、实践案例目标需求视频讲解1、选择Web Scraper API2、登录注册3、进入用户控制面板4、选择API5、触发数据收集 API6、获取爬虫结果7、分析爬虫结果&#xff08;1&…

微信小程序中使用离线版阿里云矢量图标

前言 阿里矢量图库提供的在线链接服务仅供平台体验和调试使用&#xff0c;平台不承诺服务的稳定性&#xff0c;企业客户需下载字体包自行发布使用并做好备份。 1.下载图标 将阿里矢量图库的图标先下载下来 解压如下 2.转换格式 贴一个地址用于转换格式&#xff1a;Onlin…

Ubuntu 的 ROS 操作系统安装与测试

引言 机器人操作系统&#xff08;ROS, Robot Operating System&#xff09;是一个用于开发机器人应用的开源框架&#xff0c;它提供了一系列功能丰富的库和工具&#xff0c;能够帮助开发者构建和控制机器人。 当前&#xff0c;ROS1的最新版本为Noetic Ninjemys&#xff0c;专为…

封装一个省市区的筛选组件

筛选功能&#xff1a;只能单选&#xff08;如需多选需要添加show-checkbox多选框属性&#xff09;&#xff0c;选中省传递省的ID&#xff0c;选中市传递省、市的ID&#xff0c; 选中区传递省市区的ID 父组件&#xff1a; <el-form-item><div style"width: 240px;…

python制作一个简单的端口扫描器,用于检测目标主机上指定端口的开放状态

import argparse # 用于解析命令行参数 from socket import * # 导入 socket 库的所有内容&#xff0c;用于网络通信 from threading import * # 导入 threading 库的所有内容&#xff0c;用于多线程操作 # 创建一个信号量&#xff0c;初始值为 1&#xff0c;用于线程同步&…

OceanStor Pacific系列 8.1.0 功能架构

功能架构 华为OceanStor Pacific系列提供基于三层的分布式存储架构&#xff0c;融合分布式文件、对象、大数据和块多个服务形态&#xff0c;支持文件、对象、大数据服务部署在一个集群&#xff0c;并统一管理。 华为OceanStor Pacific系列整体功能架构由存储接口层、存储服务…