Unable to use make in alpine image
Asked Answered
F

3

7

I cant get make to work in alpine make update_tools works when I run it on my OSX, but when i run it in the alpine image i get the following error: make: *** No rule to make target 'update_tools'. Stop. Here is what my Dockerfile looks like now:

#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 = "[email protected]: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

Makefile: https://github.com/cosmos/cosmos-sdk/blob/develop/Makefile

I would appreciate any pointers on this

Fictionist answered 15/3, 2019 at 21:10 Comment(2)
Can you post your Makefile?Heaney
Shared @HeaneyFictionist
M
14

Am having this issue.

It seems something from the golang-alpine image itself.

** --- Solution --- **

just install the make in your image as following:

apk add --no-cache make

Middleoftheroad answered 5/12, 2022 at 3:47 Comment(0)
H
-1

Direct clone and checkout v0.33.0 doesn't have mentioned problem. It looks like a problem with git checkout v0.33.0 command. Probably you have uncommitted changes. Please check/provide docker build output.

Harleigh answered 15/3, 2019 at 23:21 Comment(0)
E
-1

had a similar issue, make sure your Makefile is added to the docker image, mine Makefile was added to .dockerignore file, so it was not present in docker image and I got a similar error message

Enfield answered 15/9, 2021 at 14:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.