I am trying to build a project in Ubuntu in a WSL instance. The command I'm using is from a chirpstack-simulator project: docker-compose run --rm chirpstack-simulator make clean build. For some reason make refuses to work correctly, or at all.
I keep getting an error: "make: *** No rule to make target 'clean'. Stop."
Here is the Makefile code:
VERSION := $(shell git describe --always |sed -e "s/^v//")
build:
@echo "Compiling source"
@mkdir -p build
go build $(GO_EXTRA_BUILD_ARGS) -ldflags "-s -w -X main.version=$(VERSION)" -o build/chirpstack-simulator cmd/chirpstack-simulator/main.go
clean:
@echo "Cleaning up workspace"
@rm -rf build
@rm -rf dist
@rm -rf docs/public
The docker-compose.yml code:
services:
chirpstack-simulator:
build:
context: .
dockerfile: Dockerfile-devel
command: make
volumes:
- ./:/chirpstack-simulator
And the Docker-devel file:
FROM golang:1.13-alpine
ENV PROJECT_PATH=/chirpstack-simulator
ENV PATH=$PATH:$PROJECT_PATH/build
ENV CGO_ENABLED=0
ENV GO_EXTRA_BUILD_ARGS="-a -installsuffix TDM-GCC-64"
RUN apk add --no-cache ca-certificates tzdata make git bash
RUN mkdir -p $PROJECT_PATH
COPY . $PROJECT_PATH
WORKDIR $PROJECT_PATH
As you can see, both build and clean are defined. Has anyone encountered this issue before?
Edit: This is the full project I am trying to build https://github.com/brocaar/chirpstack-simulator
And further details:
I have tried doing
sudo apt-get remove make
sudo apt-get install make
then
sudo apt-get install --reinstall build-essentials
It is still giving the error.
Version of Ubuntu is 16.04 LTS if it helps narrow things down
Makefile
(ormakefile
) (not something likeMakefile.mak
or whatever)? When you run make is your working directory the one containing the makefile? Maybe add anls
and/orpwd
as a command to run, to see the contents of the directory and what directory you're in.ls pwd make
. You need to at least put semicolons between them:ls; pwd; make
(not pipe symbols). Or possibly that won't work and you should just replacemake
withls
, just to see what output you get, then put backmake
when you figure it out.docker-compose run
doesn't take arguments. Are you doingmake clean build
on a new line? Also, not sure I understand why you really need Compose here