我无法让 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/