docker - 无法在 Alpine 图像中使用 make

标签 docker makefile alpine-linux

我无法让 make 在 alpine 中工作 make update_tools 在我的 OSX 上运行时有效,但在 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 $(whoami) && \
    rm .gaiad/config/genesis.json && \
    curl https://raw.githubusercontent.com/cosmos/launch/master/genesis.json > $HOME/.gaiad/config/genesis.json 

#Add persistent peer to config.toml file
RUN sed -i '' 's/persistent_peers = ""/persistent_peers = "89e4b72625c0a13d6f62e3cd9d40bfc444cbfa77@34.65.6.52:26656"/' $HOME/.gaiad/config/config.toml 

#Start gaid daemon and set logging to info
CMD ["gaiad start --log_level="*:info""]

# Expose the ports
EXPOSE 26656 26657

生成文件:https://github.com/cosmos/cosmos-sdk/blob/develop/Makefile

如有任何指点,我将不胜感激

最佳答案

我有这个问题。

这似乎来自 golang-alpine 图像本身。

** --- 解决方案 --- **

只需在您的镜像中安装 make,如下所示:

apk add --no-cache make

关于docker - 无法在 Alpine 图像中使用 make,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55190714/

相关文章:

makefile - 如何在不同的目录中指定 makefile 目标?

在 Docker Alpine 中编译 NSS 模块 - fatal error : nss. h:没有这样的文件或目录

docker - 在 Linux Alpine 上安装 DPDK 时出错

docker - Alpine Linux是Unikernel的实现吗?

node.js - Docker 不会将文件更改从主机传播到容器

在 Makefile 中处理链接的正确方法?

c++ - Clang 看不到标题

linux - getcap/setcap 在带有 Debian Stretch 主机的 docker 容器中不工作

postgresql - 使用docker使用sequelize时SequelizeConnectionRefusedError : connect ECONNREFUSED 127. 0.0.1:5432

mysql - docker-compose:MySQL 服务未运行