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

Dockerfile文件详细教程

写在前面

Dockerfile是用来构建镜像的,他实际上就是把在linux下的命令操作写到了Dockerfile中,通过Dockerfile去执行设置好的操作命令,保证通过Dockerfile的构建镜像是一致的。

实战分析

该例子来自于 chromium 项目
主要干的事情:

  1. 来指定用哪个镜像;
  2. 安装一些编译需要的环境:C++编译环境,Java环境等
# This Dockerfile specifies the recipe for creating an image for the tests
# to run in.
#
# We install as many test dependencies here as we can, because these setup
# steps can be cached.  They do *not* run every time we run the build.
# The Docker image is only rebuilt when the Dockerfile (ie. this file)
# changes.# 指定了使用什么镜像 debian
# Base Dockerfile for gRPC dev images
FROM debian:latest# 添加软件源
# Apt source for old Python versions.
RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /etc/apt/sources.list.d/deadsnakes.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C# Apt source for Oracle Java.
RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /etc/apt/sources.list.d/webupd8team-java-trusty.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections# Apt source for Mono
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF# Apt source for php
RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc/apt/sources.list.d/various-php.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07# Install dotnet SDK based on https://www.microsoft.com/net/core#debian
# (Ubuntu instructions need apt to support https)
RUN apt-get update && apt-get install -y --force-yes curl libunwind8 gettext && \curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=847105 &&  \mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ln -s /opt/dotnet/dotnet /usr/local/bin# Install dependencies.  We start with the basic ones require to build protoc
# and the C++ build
RUN apt-get clean && apt-get update && apt-get install -y --force-yes \autoconf \autotools-dev \build-essential \bzip2 \ccache \curl \gcc \git \libc6 \libc6-dbg \libc6-dev \libgtest-dev \libtool \make \parallel \time \wget \# -- For csharp --mono-devel \referenceassemblies-pcl \nunit \# -- For all Java builds -- \maven \# -- For java_jdk6 -- \#   oops! not in jessie. too old? openjdk-6-jdk \# -- For java_jdk7 -- \openjdk-7-jdk \# -- For java_oracle7 -- \oracle-java7-installer \# -- For python / python_cpp -- \python-setuptools \python-pip \python-dev \python2.6-dev \python3.3-dev \python3.4-dev \# -- For Ruby --ruby \# -- For C++ benchmarks --cmake \# -- For PHP --php5.6     \php5.6-dev \php5.6-xml \php7.0     \php7.0-dev \php7.0-xml \phpunit    \valgrind   \libxml2-dev \&& apt-get clean##################
# C# dependenciesRUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe##################
# Python dependencies# These packages exist in apt-get, but their versions are too old, so we have
# to get updates from pip.RUN pip install pip --upgrade
RUN pip install virtualenv tox yattag##################
# Ruby dependencies# Install rvm
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN \curl -sSL https://get.rvm.io | bash -s stable# Install Ruby 2.1, Ruby 2.2 and JRuby 1.7
RUN /bin/bash -l -c "rvm install ruby-2.1"
RUN /bin/bash -l -c "rvm install ruby-2.2"
RUN /bin/bash -l -c "rvm install jruby-1.7"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"##################
# Java dependencies# This step requires compiling protoc. :(ENV MAVEN_REPO /var/maven_local_repository
ENV MVN mvn --batch-modeRUN cd /tmp && \git clone https://github.com/google/protobuf.git && \cd protobuf && \git reset --hard 129a6e2aca95dcfb6c3e717d7b9cca1f104fde39 && \./autogen.sh && \./configure && \make -j4 && \cd java && \$MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \cd ../javanano && \$MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO##################
# PHP dependencies.
RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror
RUN mv mirror php-5.5.38.tar.bz2
RUN tar -xvf php-5.5.38.tar.bz2
RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.5-zts && \make && make install && cd ..
RUN cd php-5.5.38 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.5 && \make && make install && cd ..RUN wget http://am1.php.net/get/php-5.6.30.tar.bz2/from/this/mirror
RUN mv mirror php-5.6.30.tar.bz2
RUN tar -xvf php-5.6.30.tar.bz2
RUN cd php-5.6.30 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.6-zts && \make && make install && cd ..
RUN cd php-5.6.30 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.6 && \make && make install && cd ..RUN wget http://am1.php.net/get/php-7.0.18.tar.bz2/from/this/mirror
RUN mv mirror php-7.0.18.tar.bz2
RUN tar -xvf php-7.0.18.tar.bz2
RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.0-zts && \make && make install && cd ..
RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \make && make install && cd ..RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror
RUN mv mirror php-7.1.4.tar.bz2
RUN tar -xvf php-7.1.4.tar.bz2
RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \make && make install && cd ..
RUN cd php-7.1.4 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.1 && \make && make install && cd ..RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php
RUN mv composer.phar /usr/bin/composer
RUN php -r "unlink('composer-setup.php');"
RUN composer config -g -- disable-tls true
RUN composer config -g -- secure-http false
RUN cd /tmp && \rm -rf protobuf && \git clone https://github.com/google/protobuf.git && \cd protobuf && \git reset --hard 49b44bff2b6257a119f9c6a342d6151c736586b8 && \cd php && \ln -sfn /usr/local/php-5.5/bin/php /usr/bin/php && \ln -sfn /usr/local/php-5.5/bin/php-config /usr/bin/php-config && \ln -sfn /usr/local/php-5.5/bin/phpize /usr/bin/phpize && \composer install && \mv vendor /usr/local/vendor-5.5 && \ln -sfn /usr/local/php-5.6/bin/php /usr/bin/php && \ln -sfn /usr/local/php-5.6/bin/php-config /usr/bin/php-config && \ln -sfn /usr/local/php-5.6/bin/phpize /usr/bin/phpize && \composer install && \mv vendor /usr/local/vendor-5.6 && \ln -sfn /usr/local/php-7.0/bin/php /usr/bin/php && \ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \composer install && \mv vendor /usr/local/vendor-7.0 && \ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \composer install && \mv vendor /usr/local/vendor-7.1##################
# Go dependencies.
RUN apt-get install -y  \# -- For go -- \golang##################
# Javascript dependencies.
RUN apt-get install -y \# -- For javascript -- \npm##################
# Python 3.5 3.6 dependencies.
RUN apt-get clean && apt-get update && apt-get install -y --force-yes \python3.5-dev \python3.6-dev \&& apt-get clean# On Debian/Ubuntu, nodejs binary is named 'nodejs' because the name 'node'
# is taken by another legacy binary. We don't have that legacy binary and
# npm expects the binary to be named 'node', so we just create a symbol
# link here.
RUN ln -s `which nodejs` /usr/bin/node##################
# Prepare ccacheRUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ln -s /usr/bin/ccache /usr/local/bin/g++
RUN ln -s /usr/bin/ccache /usr/local/bin/cc
RUN ln -s /usr/bin/ccache /usr/local/bin/c++
RUN ln -s /usr/bin/ccache /usr/local/bin/clang
RUN ln -s /usr/bin/ccache /usr/local/bin/clang++# Define the default command.
CMD ["bash"]

常见命令解释

FROM 指定镜像源

FROM ubuntu
# Base Dockerfile for gRPC dev images
FROM debian:latest

网站:http://hub.docker.com
FROM命令是用来指定你需要用哪个镜像作为基础镜像进行构建,一般来说Dockerfile的第一行都会先指定一个镜像,官方仓库中有很多镜像,可以通过http://hub.docker.com进行搜索,建议尽量使用官方镜像作为基础镜像,因为官方镜像都是精简过的稳定版。

RUN 执行linux命令

比如我们需要安装vim
写法1:

RUN apt-get update -y
RUN apt-get install -y vim

RUN是用来执行linux命令的指令,例如ubuntu系统下,需要更新软件包list,就需要执行apt-get update,之后会跟着执行apt-get install
写法2:

RUN apt-get update -y \&& apt-get install -y vim

参考例子:

# Apt source for old Python versions.
RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /etc/apt/sources.list.d/deadsnakes.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C# Apt source for Oracle Java.
RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /etc/apt/sources.list.d/webupd8team-java-trusty.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections# Apt source for Mono
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF# Apt source for php
RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc/apt/sources.list.d/various-php.list && \apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07# Install dotnet SDK based on https://www.microsoft.com/net/core#debian
# (Ubuntu instructions need apt to support https)
RUN apt-get update && apt-get install -y --force-yes curl libunwind8 gettext && \curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=847105 &&  \mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ln -s /opt/dotnet/dotnet /usr/local/bin# Install dependencies.  We start with the basic ones require to build protoc
# and the C++ build
RUN apt-get clean && apt-get update && apt-get install -y --force-yes \autoconf \autotools-dev \build-essential \bzip2 \ccache \curl \gcc \git \libc6 \libc6-dbg \libc6-dev \libgtest-dev \libtool \make \parallel \time \wget \# -- For csharp --mono-devel \referenceassemblies-pcl \nunit \# -- For all Java builds -- \maven \# -- For java_jdk6 -- \#   oops! not in jessie. too old? openjdk-6-jdk \# -- For java_jdk7 -- \openjdk-7-jdk \# -- For java_oracle7 -- \oracle-java7-installer \# -- For python / python_cpp -- \python-setuptools \python-pip \python-dev \python2.6-dev \python3.3-dev \python3.4-dev \# -- For Ruby --ruby \# -- For C++ benchmarks --cmake \# -- For PHP --php5.6     \php5.6-dev \php5.6-xml \php7.0     \php7.0-dev \php7.0-xml \phpunit    \valgrind   \libxml2-dev \&& apt-get clean##################
# C# dependenciesRUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe##################
# Python dependencies# These packages exist in apt-get, but their versions are too old, so we have
# to get updates from pip.RUN pip install pip --upgrade
RUN pip install virtualenv tox yattag##################
# Ruby dependencies# Install rvm
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN \curl -sSL https://get.rvm.io | bash -s stable# Install Ruby 2.1, Ruby 2.2 and JRuby 1.7
RUN /bin/bash -l -c "rvm install ruby-2.1"
RUN /bin/bash -l -c "rvm install ruby-2.2"
RUN /bin/bash -l -c "rvm install jruby-1.7"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"

USER 指定当前用户

USER root
USER username

EXPOSE 暴露端口

声明端口,作用是帮助镜像使用者理解这个镜像服务的守护端口,以方便配置映射。在运行时使用随机端口映射时,也就是 docker run -P时,会自动随机映射EXPOSE的端口。

EXPOSE <端口1> [<端口2>...]

在 Dockerfile 中写入这样的声明有两个好处:

  1. 一个是帮助镜像使用者理解这个镜像服务的守护端口,以方便配置映射;
  2. 另一个用处则是在运行时使用随机端口映射时,也就是 docker run -P 时,会自动随机映射 EXPOSE 的端口。
    例子:
EXPOSE 端口号
EXPOSE 端口号/协议

默认协议是 TCP

EXPOSE 80/tcp
EXPOSE 80/udp
FROM nginx
EXPOSE 80

在docker-compose中

通常在docker-compose中,会通过ports来映射并暴露端口,docker-compose用法如下:

ports:- "8001:80"

相关文章:

Dockerfile文件详细教程

写在前面 Dockerfile是用来构建镜像的&#xff0c;他实际上就是把在linux下的命令操作写到了Dockerfile中&#xff0c;通过Dockerfile去执行设置好的操作命令&#xff0c;保证通过Dockerfile的构建镜像是一致的。 实战分析 该例子来自于 chromium 项目 主要干的事情&#xf…...

机器学习-模型评估与选择

文章目录 评估方法留出法交叉验证自助法 性能的衡量回归问题分类问题查准率、查全率与F1ROC与AUC 在机器学习中&#xff0c;我们通常面临两个主要问题&#xff1a;欠拟合和过拟合。欠拟合指模型无法在训练数据上获得足够低的误差&#xff0c;通常是因为模型太简单&#xff0c;无…...

分享一下办公自动化常用的思想

目录 网页获取数据需求①大体思路&#xff1a;PythonseleniumXpath 网页获取数据需求②大体思路&#xff1a;requests爬虫 批量生成需求①文件的移动、重命名②word、Excel批量生成 匹配需求 网页获取数据需求① 大体思路&#xff1a;PythonseleniumXpath 我们在利用Python做…...

mac vscode 使用 clangd

C 的智能提示 IntelliSense 非常不准&#xff0c;我们可以使用 clangd clangd 缺点就是配置繁琐&#xff0c;优点就是跳转和提示代码精准 开启 clangd 之后会提示你关闭 IntelliSense 1、安装插件 clangd 搜索第一个下载多的就是 2、配置 clangd 可执行程序路径 clangd 插…...

DSI及DPHY的学习

DSI的物理层PHY只能是DPHY 本节讲述的DSI是V1.02.00---2010.6.28 从DSI V1.02开始DSI支持图像数据包RGB和YCbCr的传输&#xff0c;在此版本之前只支持RGB传输。 本节内容与CSICDPHY相同时 请参考&#xff1a; CSI2与CDPHY学习-CSDN博客 同时本节会做一些与CSICDPHY的比较 …...

环形链表(C++解法)

题目 给你一个链表的头节点 head &#xff0c;判断链表中是否有环。 如果链表中有某个节点&#xff0c;可以通过连续跟踪 next 指针再次到达&#xff0c;则链表中存在环。 为了表示给定链表中的环&#xff0c;评测系统内部使用整数 pos 来表示链表尾连接到链表中的位置&#…...

星闪技术 NearLink 一种专门用于短距离数据传输的新型无线通信技术

本心、输入输出、结果 文章目录 星闪技术 NearLink 一种专门用于短距离数据传输的新型无线通信技术前言星闪技术 NearLink 的诞生背景星闪技术 NearLink 简介星闪技术 NearLink 技术是一种蓝牙技术吗星闪技术 NearLink 优势星闪技术 NearLink 应用前景弘扬爱国精神星闪技术 Nea…...

【Python机器学习】零基础掌握RandomForestRegressor集成学习

如何预测房价是不是一直困扰着大家?特别是在房地产市场波动不定的情况下,这样的预测可以说是切实需要。 要解决这个问题,一个可行的方法是利用历史房价数据和房屋的各种属性(如面积、楼层、地理位置等)进行分析。通过这些数据,可以用一个模型来预测未来房价。 假设有以…...

FreeRTOS深入教程(任务创建的深入和任务调度机制分析)

文章目录 前言一、深入理解任务的创建二、任务的调度机制1.FreeRTOS中任务调度的策略2.FreeRTOS任务调度策略实现的核心3.FreeRTOS内部链表源码解析4.如何通过就绪链表管理任务的执行顺序 三、一个任务能够运行多久1.高优先级任务可抢占低优先级任务一直运行2.相同优先级的任务…...

Megatron-LM GPT 源码分析(一) Tensor Parallel分析

引言 本文基于开源代码 GitHub - NVIDIA/Megatron-LM: Ongoing research training transformer models at scale &#xff0c;通过GPT的模型运行示例&#xff0c;从三个维度 - 模型结构、代码运行、代码逻辑说明 对其源码做深入的分析。 Tensor Parallel源码分析...

分类预测 | MATLAB实现SSA-CNN-GRU麻雀算法优化卷积门控循环单元数据分类预测

分类预测 | MATLAB实现SSA-CNN-GRU麻雀算法优化卷积门控循环单元数据分类预测 目录 分类预测 | MATLAB实现SSA-CNN-GRU麻雀算法优化卷积门控循环单元数据分类预测分类效果基本描述程序设计参考资料 分类效果 基本描述 1.MATLAB实现SSA-CNN-GRU麻雀算法优化卷积门控循环单元数据…...

婚礼的魅力

昨日有幸被邀请去当伴郎&#xff0c;虽然是替补&#xff0c;即别人鸽了&#xff0c;过去救急&#xff0c;但总归是去起作用。 婚礼的魅力&#xff0c;感受到了&#xff0c;满满的仪式感&#xff0c;紧凑的流程&#xff0c;还有不断的拍照&#xff0c;做视频&#xff0c;留下美好…...

【计算机网络笔记】DNS报文格式

DNS 提供域名到主机IP地址的映射  域名服务的三大要素&#xff1a;  域&#xff08;Domain&#xff09;和域名(Domain name)&#xff1a; 域指由地 理位置或业务类型而联系在一起的一组计算机构 成。  主机&#xff1a;由域名来标识。域名是由字符和&#xff08;或&a…...

10月28日

...

【性能测试】初识 Jmeter 中的 BeanShell

初识 Jmeter 中的 BeanShell 1.简介1.1 应用场景1.2 BeanShell 类型 2.常用内置变量2.1 log 日志模块2.2 vars 模块2.3 props 模块2.4 prev 模块 3.常见应用场景3.1 Java 文件处理3.2 导入外部 jar 包 BeanShell 是一个小型嵌入式 Java 源代码解释器&#xff0c;完全兼容 Java …...

Rust实现基于Tokio的限制内存占用的channel

Rust实现基于Tokio的限制内存占用的channel 简介 本文介绍如何基于tokio的channel实现一个限制内存占用的channel。 Tokio提供了多种协程间同步的接口&#xff0c;用于在不同的协程中同步数据。 常用的channel有两种:bounded和unbounded&#xff0c;其中ubbounded的channel可…...

【C++】C++入门(上)--命名空间 输入输出 缺省参数 函数重载

目录 一 命名空间 1 命名空间的定义 2 命名空间的使用 二 C输入和输出 1 输出 2 输入 三 缺省参数 1 缺省参数概念 2 缺省参数分类 (1) 全缺省参数 (2)半缺省参数 四 函数重载 1 函数重载概念 2 分类 1 参数类型不同 2 参数个数不同 3 参数类型顺序不同 3 C为什…...

设计模式:原型模式(C#、JAVA、JavaScript、C++、Python、Go、PHP)

上一篇《访问者模式》 下一篇《享元模式》 简介&#xff1a; 原型模式&#xff0c;它是一种创建型设计模式&#xff0c;它允许通过复制原型对象来创建新的对象&#xff0c;而无需知道创建的细节。其工作原…...

SpringMVC 资源状态转移RESTful

文章目录 1、RESTful简介a>资源b>资源的表述c>状态转移 2、RESTful的实现HiddenHttpMethodFilterRESTful案例 1、RESTful简介 REST&#xff1a;Representational State Transfer&#xff0c;表现层资源状态转移。 a>资源 资源是一种看待服务器的方式&#xff0c…...

verilog vscode linux

安装 vscode 插件 插件&#xff1a;Verilog-HDL/SystemVerilog/Bluespec SystemVerilog 功能&#xff1a;.xdc .ucf .v 等代码高亮、代码格式化、语法检查&#xff08;Linting&#xff09;、光标放到变量上提示变量的信息等 关于其他语言的依赖工具等信息查看插件说明 代码对齐…...

深入剖析AI大模型:大模型时代的 Prompt 工程全解析

今天聊的内容&#xff0c;我认为是AI开发里面非常重要的内容。它在AI开发里无处不在&#xff0c;当你对 AI 助手说 "用李白的风格写一首关于人工智能的诗"&#xff0c;或者让翻译模型 "将这段合同翻译成商务日语" 时&#xff0c;输入的这句话就是 Prompt。…...

springboot 百货中心供应链管理系统小程序

一、前言 随着我国经济迅速发展&#xff0c;人们对手机的需求越来越大&#xff0c;各种手机软件也都在被广泛应用&#xff0c;但是对于手机进行数据信息管理&#xff0c;对于手机的各种软件也是备受用户的喜爱&#xff0c;百货中心供应链管理系统被用户普遍使用&#xff0c;为方…...

三维GIS开发cesium智慧地铁教程(5)Cesium相机控制

一、环境搭建 <script src"../cesium1.99/Build/Cesium/Cesium.js"></script> <link rel"stylesheet" href"../cesium1.99/Build/Cesium/Widgets/widgets.css"> 关键配置点&#xff1a; 路径验证&#xff1a;确保相对路径.…...

渗透实战PortSwigger靶场-XSS Lab 14:大多数标签和属性被阻止

<script>标签被拦截 我们需要把全部可用的 tag 和 event 进行暴力破解 XSS cheat sheet&#xff1a; https://portswigger.net/web-security/cross-site-scripting/cheat-sheet 通过爆破发现body可以用 再把全部 events 放进去爆破 这些 event 全部可用 <body onres…...

基于Uniapp开发HarmonyOS 5.0旅游应用技术实践

一、技术选型背景 1.跨平台优势 Uniapp采用Vue.js框架&#xff0c;支持"一次开发&#xff0c;多端部署"&#xff0c;可同步生成HarmonyOS、iOS、Android等多平台应用。 2.鸿蒙特性融合 HarmonyOS 5.0的分布式能力与原子化服务&#xff0c;为旅游应用带来&#xf…...

sqlserver 根据指定字符 解析拼接字符串

DECLARE LotNo NVARCHAR(50)A,B,C DECLARE xml XML ( SELECT <x> REPLACE(LotNo, ,, </x><x>) </x> ) DECLARE ErrorCode NVARCHAR(50) -- 提取 XML 中的值 SELECT value x.value(., VARCHAR(MAX))…...

leetcodeSQL解题:3564. 季节性销售分析

leetcodeSQL解题&#xff1a;3564. 季节性销售分析 题目&#xff1a; 表&#xff1a;sales ---------------------- | Column Name | Type | ---------------------- | sale_id | int | | product_id | int | | sale_date | date | | quantity | int | | price | decimal | -…...

JUC笔记(上)-复习 涉及死锁 volatile synchronized CAS 原子操作

一、上下文切换 即使单核CPU也可以进行多线程执行代码&#xff0c;CPU会给每个线程分配CPU时间片来实现这个机制。时间片非常短&#xff0c;所以CPU会不断地切换线程执行&#xff0c;从而让我们感觉多个线程是同时执行的。时间片一般是十几毫秒(ms)。通过时间片分配算法执行。…...

Redis数据倾斜问题解决

Redis 数据倾斜问题解析与解决方案 什么是 Redis 数据倾斜 Redis 数据倾斜指的是在 Redis 集群中&#xff0c;部分节点存储的数据量或访问量远高于其他节点&#xff0c;导致这些节点负载过高&#xff0c;影响整体性能。 数据倾斜的主要表现 部分节点内存使用率远高于其他节…...

USB Over IP专用硬件的5个特点

USB over IP技术通过将USB协议数据封装在标准TCP/IP网络数据包中&#xff0c;从根本上改变了USB连接。这允许客户端通过局域网或广域网远程访问和控制物理连接到服务器的USB设备&#xff08;如专用硬件设备&#xff09;&#xff0c;从而消除了直接物理连接的需要。USB over IP的…...