我的操作环境仅为Alpine linux,我需要安装VS Code。VS Code 如何在 Alpine Linux 上运行?
当我在 OSX 上运行它时,我无法make在 alpine 中工作
make update_tools,但是当我在 alpine 映像中运行它时,我收到以下错误:make:***没有规则来创建目标“update_tools”。停止。这是我的 Dockerfile 现在的样子:
#Download base image Alpine-3.9 Golang 1.12
FROM golang:1.12-alpine3.9
# Set Working Directory is /usr/app
WORKDIR /usr/app
# Install Alpine Dependencies
RUN apk update && apk upgrade && apk add --update alpine-sdk && \
apk add --no-cache bash git openssh make cmake
COPY cosmos-sdk .
WORKDIR /usr/app/cosmos-sdk
RUN git checkout v0.33.0 && \
make update_tools && \
make vendor-deps && \
make install && \
gaiad init …Run Code Online (Sandbox Code Playgroud) 我致力于在基于 alpine 的容器上使用 golang 在 python 脚本(ctypes loadlibrary)中构建共享库。
/usr/src/app # **go build -o cc.so -buildmode=c-shared main.go**
/usr/src/app # **readelf -d cc.so**
Dynamic section at offset 0x10cd10 contains 22 entries: Tag Type
Name/Value 0x0000000000000001 (NEEDED) Shared library:
[libc.musl-x86_64.so.1] 0x0000000000000010 (SYMBOLIC) 0x0
0x000000000000000c (INIT) 0x42000 0x000000000000000d (FINI) 0x92ed9
0x0000000000000019 (INIT_ARRAY) 0xa2078 0x000000000000001b
(INIT_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x270
0x0000000000000005 (STRTAB) 0xa50 0x0000000000000006 (SYMTAB) 0x378
0x000000000000000a (STRSZ) 1026 (bytes) 0x000000000000000b (SYMENT) 24
(bytes) 0x0000000000000003 (PLTGOT) 0x10deb0 0x0000000000000002
(PLTRELSZ) 720 (bytes) 0x0000000000000014 (PLTREL) …Run Code Online (Sandbox Code Playgroud) 我正在 Docker Alpine 镜像中编写一个简单的网络爬虫。但是,我无法将 HTTPS 请求发送到仅支持 TLS1.0 的服务器。如何配置 Alpine linux 以允许过时的 TLS 版本?
我尝试添加MinProtocol但/etc/ssl/openssl.cnf没有运气。
Dockerfile 示例:
FROM node:12.0-alpine
RUN printf "[system_default_sect]\nMinProtocol = TLSv1.0\nCipherString = DEFAULT@SECLEVEL=1" >> /etc/ssl/openssl.cnf
CMD ["/usr/bin/wget", "https://www.restauracesalanda.cz/"]
Run Code Online (Sandbox Code Playgroud)
当我构建并运行这个容器时,我得到
Connecting to www.restauracesalanda.cz (93.185.102.124:443)
ssl_client: www.restauracesalanda.cz: handshake failed: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
wget: error getting response: Connection reset by peer
Run Code Online (Sandbox Code Playgroud) 在 Docker 中,我尝试运行 pip install ortools 但找不到。其他 pip 安装包可以完美运行。我在 Dockerfile 中使用“FROM python:3.6.8-alpine”
bash-4.4# pip install ortools
Collecting ortools
ERROR: Could not find a version that satisfies the requirement ortools (from versions: none)
ERROR: No matching distribution found for ortools
bash-4.4# pip install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.1.1)
Run Code Online (Sandbox Code Playgroud)
根本原因: Gooogle OR 工具不支持 alpine,因为 alpine 不支持 pypi
这是基于https://testdriven.io/courses/microservices-with-docker-flask-and-react/
\n\n我正在运行一个指向entrypoint.sh 的docker 文件。
\n\n成功docker-compose-f docker-compose-dev.yml build run\n但正在运行docker-compose-f docker-compose-dev.yml up显示
ERROR: for users Cannot start service users: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \\"/usr/src/app/entrypoint.sh\\": permission denied": unknown\nERROR: Encountered errors while bringing up the project.\nRun Code Online (Sandbox Code Playgroud)\n\n我确实尝试使用docker run -it \xe2\x80\x93tty users_app:latest sh.\nRunning在交互模式下运行./entrypoint.sh运行确实有效。\n但它不适用于 docker-compose。
有人有同样的问题吗?
\n\n这是我的 docker-compose-dev.yml、Dockerfile-dev 和 entrypoint.sh
\n\ndocker-compose-dev.yml
\n\nversion: \'3.6\'\n\nservices:\n users:\n build:\n context: ./services/users\n dockerfile: Dockerfile-dev\n volumes:\n - \'./services/users:/usr/src/app\'\n ports:\n …Run Code Online (Sandbox Code Playgroud) 我正在尝试覆盖基于 alpine 的 pod 的 dnsconfig(特别是搜索域)。
但dnsconfig似乎在 pod 对象中可用。
无论如何,是否可以在部署对象中提供 dnsconfig 或任何其他解决方法来覆盖该特定 pod 的 searchdomain。
学习 kubernetes,我正在尝试在 docker 上运行的 alpine 容器中旋转 minikube 集群。不管这是否可能,我不明白为什么内核无法看到“minikube”作为可执行文件存在于 /usr/local/bin 中。我能够执行“kubectl”,尽管它存在于同一路径中。
我已经尝试从 root 和 /usr/local/bin 路径执行“minikube”、“./minikube”。我也查过类似的问题,但解决方案没有帮助。
以下是我在屏幕上看到的内容。“kubectl”和“minikube”都显示为绿色。
/usr/local/bin # ls -l
total 96540
-rwxr-xr-x 1 root root 42985504 Aug 18 11:31 kubectl
-rwxr-xr-x 1 root root 55869264 Aug 18 11:36 minikube
/usr/local/bin # minikube
/bin/sh: minikube: not found
/usr/local/bin # ./minikube
/bin/sh: ./minikube: not found
/usr/local/bin # minikube --help
/bin/sh: minikube: not found
/usr/local/bin #
Run Code Online (Sandbox Code Playgroud)
我希望“minikube”执行并抛出帮助或错误消息。但是,我看到的是内核的错误,无法找到具有该名称的任何可执行文件。
我尝试git-lfs在 Docker alpine 映像中安装,但收到一条错误消息,指示:
错误:无法满足的约束:
git-lfs(丢失):
需要:世界[git-lfs]
似乎存在许多与 apk 找不到软件包相关的问题(请参阅此处和那里),并且在许多情况下,这些问题已通过--no-cache使用apk add. 但我没有那么幸运,无法理解这个错误的根源,特别是考虑到 git-lfs 在alpine repo中是最新的。
以下小 Dockerfile 应该会重现该错误:
FROM alpine:3.4
RUN apk update && apk add --no-cache \
build-base \
git \
git-lfs
Run Code Online (Sandbox Code Playgroud) 我是 Docker 新手,一直在尝试将 python 脚本包装在容器中,但在我的对接 alpine 实例上安装 scipy 0.17.0(作为 scikit-learn 的依赖项)时遇到错误我一直没能找到答案。
我的 Dockerfile:
FROM python:alpine
COPY . /app
WORKDIR /app
RUN apk add --no-cache python3-dev libstdc++ && \
apk add --no-cache g++ && \
ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip3 install -r requirements.txt
CMD python ./python_script.py
Run Code Online (Sandbox Code Playgroud)
我的requirements.txt文件:
numpy==1.16.5
pandas==0.25.2
scikit-learn==0.21.3
Run Code Online (Sandbox Code Playgroud)
输出:
Sending build context to Docker daemon 1.097GB
Step 1/7 : FROM python:alpine
---> 204216b3821e
Step 2/7 : COPY . /app
---> 1e06520a2b68
Step 3/7 : WORKDIR /app
---> Running …Run Code Online (Sandbox Code Playgroud)