我正在 Alpine Linux 上安装 sqlite。我下载了sqlite-autoconf-3130000.tar.gz
但是tar
打不开。我试过这个答案,但它不起作用。tar
给出这个消息:
tar: invalid magic
tar: short read
Run Code Online (Sandbox Code Playgroud)
我写了这些命令。
wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz
tar -zxvf sqlite-autoconf-3090100.tar.gz
Run Code Online (Sandbox Code Playgroud) 我使用以下 Dockerfile在Docker 容器中构建了Alpine Linux:
FROM alpine:3.2
RUN apk add --update jq curl && rm -rf /var/cache/apk/*
Run Code Online (Sandbox Code Playgroud)
构建运行成功:
$ docker build -t collector .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon
Step 0 : FROM alpine:3.2
3.2: Pulling from alpine
8697b6cc1f48: Already exists
alpine:3.2: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: …
Run Code Online (Sandbox Code Playgroud) 我在服务器端有两个网卡, eth0 ?192.168.8.140 和 eth1 ?192.168.8.142。客户端向 192.168.8.142 发送数据,我希望iftop
显示 eth1 的流量,但它没有。所有网络都经过eth0,那么如何测试两个网卡?
为什么所有的流量都通过 eth0 而不是 eth1?我预计每个接口可以获得 1 Gbit/s。我的设置或配置有什么问题?
如果配置
eth0 Link encap:Ethernet HWaddr 00:00:00:19:26:B0
inet addr:192.168.8.140 Bcast:0.0.0.0 Mask:255.255.252.0
inet6 addr: 0000::0000:0000:fe19:26b0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45287446 errors:0 dropped:123343 overruns:2989 frame:0
TX packets:3907747 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:66881007720 (62.2 GiB) TX bytes:261053436 (248.9 MiB)
Memory:f7e00000-f7efffff
eth1 Link encap:Ethernet HWaddr 00:00:00:19:26:B1
inet addr:192.168.8.142 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: 0000::0000:0000:fe19:26b1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 …
Run Code Online (Sandbox Code Playgroud) 我想知道,给定一个二进制文件的名称,我应该在 Alpine Linux 上安装哪个包。
我怎样才能做到这一点?
我正在摆弄一个 Docker 映像,它是使用 Packer 从 Virtualbox VM 构建的。该映像是 Alpine Linux 5.3.0,但apk
似乎已被删除。
如何重新安装apk
或从源代码构建它?谷歌搜索似乎只会对安装软件包或 Android 应用程序的人产生结果!
我想使用 Alpine Linux 和 LibreOffice 创建一个 Docker 图像来呈现 PDF 文档。LibreOffice 源文件使用微软的 Times New Roman 字体。
如何apk
在 Alpine Linux 上安装 Microsoft 字体?是否有与 Ubuntus 等效的数据包apt install ttf-mscorefonts-installer
?
更新 1:
同时,我找到了一个名为的包[msttcorefonts-installer][1]
,它似乎提供了我正在寻找的东西。当我尝试使用 Alpine Linux 3.7 安装它时,apk add msttcorefonts-installer-3.6-r2
出现以下错误:
ERROR: unsatisfiable constraints:
msttcorefonts-installer-3.6-r2 (missing):
required by: world[msttcorefonts-installer-3.6-r2]
Run Code Online (Sandbox Code Playgroud) 我已经完成了以下 shell 脚本,这些脚本/etc/issue
使用所有非环回接口的当前 ip更新:
#!/bin/sh
echo "You can use one of the following ip addresses in order to look the page or even ssh into the machine" > /etc/issue
ip -4 -o addr show up scope global | awk '{print $2,":",$4}'| sed -e "s/\/[1-9]*//" >> /etc/issue
Run Code Online (Sandbox Code Playgroud)
现在我想让它在启动时运行,以便/etc/issue
使用网络 ips更新。在基于 Debian 的发行版上,我会把它放在上面,/etc/rc.local
但 alpine 没有这个文件。我将如何使这个脚本以等效的方式运行/etc/rc.local
?
我试图戴上它,/etc/local.d
但它未能正确改变/etc/issue
我想问Alpine是否可以安装Ubuntu或Debian软件包?我知道 Alpine 使用 musl 而 Debian 使用 glibc。不过我想知道是否有可能无需太多工作。我正在尝试将之前在 Ubuntu 上运行的服务器移植到 Alpine,但我意识到 Nginx sub_filter 在 Alpine 版本的 Nginx 上不可用,我需要该模块。
sort -V
在alpine linux下怎么办?
sort: unrecognized option: V
BusyBox v1.28.4 (2018-12-06 15:13:21 UTC) multi-call binary.
Usage: sort [-nrugMcszbdfiokt] [-o FILE] [-k start[.offset][opts][,end[.offset][opts]] [-t CHAR] [FILE]...
Sort lines of text
-o FILE Output to FILE
-c Check whether input is sorted
-b Ignore leading blanks
-f Ignore case
-i Ignore unprintable characters
-d Dictionary order (blank or alphanumeric only)
-g General numerical sort
-M Sort month
-n Sort numbers
-t CHAR Field separator
-k N[,M] Sort by Nth field
-r Reverse …
Run Code Online (Sandbox Code Playgroud) 在运行 Bash 5.1.4(1) 的 dockerized Alpine 3.14.2 中,我在 Bash 脚本中遇到了奇怪的行为。最重要的是测试文件的可执行性,但总是失败。简而言之,这是 if 测试:
bash-5.1# if [ ! -x /opt/java/openjdk/bin/java ]; then echo "something strange just happened"; fi
something strange just happened
Run Code Online (Sandbox Code Playgroud)
但是,我所知道的多种“测试”可执行性的方法都显示出不同的结果:
bash-5.1# ls -la /opt/java/openjdk/bin/java
-rwxr-xr-x 1 root root 12648 Jan 21 2021 /opt/java/openjdk/bin/java
bash-5.1# stat -c "%A" /opt/java/openjdk/bin/java
-rwxr-xr-x
bash-5.1# /opt/java/openjdk/bin/java --version
openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing)
Run Code Online (Sandbox Code Playgroud)
为了让我的脚本正常工作,Bash 内的可执行性测试应该返回正确的结果。但为什么不呢?
我检查或尝试过一长串内容,其中一些是根据社区的建议进行的:
bash-5.1# …
Run Code Online (Sandbox Code Playgroud)