我创建了一个自定义 docker 映像并将其推送到 docker hub,但是当我在 CI/CD 中运行它时,它给了我这个错误。
exec /usr/bin/sh: exec format error
在哪里 :
Dockerfile
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y python3-pip
RUN pip3 install robotframework
Run Code Online (Sandbox Code Playgroud)
.gitlab-ci.yml
robot-framework:
image: rethkevin/rf:v1
allow_failure: true
script:
- ls
- pip3 --version
Run Code Online (Sandbox Code Playgroud)
输出
Running with gitlab-runner 15.1.0 (76984217)
on runner zgjy8gPC
Preparing the "docker" executor
Using Docker executor with image rethkevin/rf:v1 ...
Pulling docker image rethkevin/rf:v1 ...
Using docker image sha256:d2db066f04bd0c04f69db1622cd73b2fc2e78a5d95a68445618fe54b87f1d31f for rethkevin/rf:v1 with digest rethkevin/rf@sha256:58a500afcbd75ba477aa3076955967cebf66e2f69d4a5c1cca23d69f6775bf6a …Run Code Online (Sandbox Code Playgroud) 我需要一些帮助.可能只显示一个提交ID?由于git log -3显示从1到3的日志,我只想显示3.什么可能的命令将匹配它?
我用这个命令
git log -3 --pretty=format:"%h"
Run Code Online (Sandbox Code Playgroud)
结果是
ffbef87
cf0e073
1c76c5d
Run Code Online (Sandbox Code Playgroud)
我只想显示1c76c5d.
我无法在 Ubuntu 18 中安装 php8.2-fpm,这是我的安装命令:
sudo apt install lsb-release apt-transport-https ca-certificates software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2
Run Code Online (Sandbox Code Playgroud)
这是响应,包括错误:
$ sudo apt-get install php8.2 php8.2-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.2
E: Couldn't find any package by glob 'php8.2'
E: Couldn't find any package by regex 'php8.2'
E: Unable to locate package php8.2-fpm
E: Couldn't find any package by glob 'php8.2-fpm'
E: Couldn't find …Run Code Online (Sandbox Code Playgroud) 我需要帮助.我想以递归方式将所有文件重命名为目录.我有一个代码来测试,但它只在该文件夹中重命名而不是递归.如何以递归方式完成它.
这是我使用的代码
<?php
$directory="/data";
$files = scandir($directory);
foreach($files as $key=>$name){
$oldName = $name;
$newName = strtolower($name);
rename("$directory/$oldName","$directory/$newName");
}
?>
Run Code Online (Sandbox Code Playgroud) 需要一些帮助。如何在使用 docker compose 运行时解决此问题。
2020-08-10T08:24:49.653807Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.21) initializing of server in progress as process 44
2020-08-10T08:24:49.664010Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-10T08:24:52.877117Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-08-10T08:24:57.629900Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-08-10T08:25:03.057763Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21) starting as process 91
2020-08-10T08:25:03.106631Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-10T08:25:04.594295Z …Run Code Online (Sandbox Code Playgroud) 我需要一些帮助,是否有可能像这样爆炸?我有一个字符串45-test-sample,是否有可能
[0]=>string == "45"
[1]=>string == "test-sample"
Run Code Online (Sandbox Code Playgroud)
怎么做到呢?
需要帮助我有这个
service {
name = "nginx"
tags = [ "nginx", "web", "urlprefix-/nginx" ]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
Run Code Online (Sandbox Code Playgroud)
如果返回 200 响应(如 localhost:8080/test/index.html),我如何为特定 URI 添加运行状况