Skip to content

Commit

Permalink
Removed V6 temporarily to see if fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Jul 8, 2021
1 parent 79ce552 commit e6c5680
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
8 changes: 5 additions & 3 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ platform:
os: linux
arch: amd64

steps:

steps:
- name: Build Containers
image: docker
Expand All @@ -94,11 +96,11 @@ steps:
- mkdir -p ~/.docker/cli-plugins
- cp buildx-v0.5.1.linux-amd64 ~/.docker/cli-plugins/docker-buildx
- chmod a+x ~/.docker/cli-plugins/docker-buildx
- docker buildx create --use
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker buildx create --name multiarch --driver docker-container --use
- CROSS_BUILD=true RELEASE_BUILD=true make agent-image
- CROSS_BUILD=true RELEASE_BUILD=true make agentctl-image
- make CROSS_BUILD=true RELEASE_BUILD=true agent-image
- make CROSS_BUILD=true RELEASE_BUILD=true agentctl-image

volumes:
- name: docker
host:
Expand Down
51 changes: 25 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ docker-build = docker build $(DOCKER_BUILD_FLAGS)

ifeq ($(CROSS_BUILD),true)
DOCKERFILE = Dockerfile.buildx

docker-build = docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 $(DOCKER_BUILD_FLAGS)
endif

#############
Expand Down Expand Up @@ -114,45 +112,46 @@ agent: cmd/agent/agent
agentctl: cmd/agentctl/agentctl

cmd/agent/agent: cmd/agent/main.go
echo $(TARGETPLATFORM)
go clean -i net
go install -tags netgo std
@echo $(TARGETPLATFORM)
@echo $(IMAGE_TAG)
@echo $(RELEASE_BUILD)
ifeq ($(TARGETPLATFORM),normal)
export CGO_ENABLED=1 GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
export CGO_ENABLED=1 GO111MODULE=auto; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/amd64)
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
export CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=auto CC=gcc CCX=g++ ; go build -x $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),'linux/arm64')
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
ifeq ($(TARGETPLATFORM),linux/arm64)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build -x $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),' linux/arm/v7')
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
ifeq ($(TARGETPLATFORM),linux/arm/v7)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build -x $(CGO_FLAGS) -o $@ ./$(@D)
endif
$(NETGO_CHECK)


cmd/agentctl/agentctl: cmd/agentctl/main.go
go clean -i net
go install -tags netgo std
ifeq ($(TARGETPLATFORM),'')
export CGO_ENABLED=1 GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
@echo $(TARGETPLATFORM)
ifeq ($(TARGETPLATFORM),normal)
export CGO_ENABLED=1 GO111MODULE=auto ; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),'linux/amd64')
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
ifeq ($(TARGETPLATFORM),linux/amd64)
export CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),'linux/arm64')
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
ifeq ($(TARGETPLATFORM),linux/arm64)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),' linux/arm/v7')
export CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
ifeq ($(TARGETPLATFORM),linux/arm/v7)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
$(NETGO_CHECK)

agent-image:
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agent:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agent/$(DOCKERFILE) .
agent-image:
# docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agent:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agent/$(DOCKERFILE) .
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agent:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agent/$(DOCKERFILE) .

agentctl-image:
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agentctl:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agentctl/$(DOCKERFILE) .
agentctl-image:
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agentctl:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agentctl/$(DOCKERFILE) .

install:
CGO_ENABLED=1 go install $(CGO_FLAGS) ./cmd/agent
Expand All @@ -172,7 +171,7 @@ test:
CGO_ENABLED=1 go test $(CGO_FLAGS) -cover -coverprofile=cover-norace.out -p=4 ./pkg/integrations/node_exporter ./pkg/loki

clean:
rm -rf cmd/agent/agent
rm -r -f cmd/agent/agent
go clean ./...

example-kubernetes:
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ARG IMAGE_TAG

# Rename seego's /go_wrapper.sh to /seego.sh for readability in the
# Makefile.
RUN cp /go_wrapper.sh /seego.sh
RUN IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false make agent
# RUN cp /go_wrapper.sh /seego.sh
RUN make clean && IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false make agent

FROM debian:buster-slim

Expand Down
4 changes: 2 additions & 2 deletions cmd/agentctl/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ARG IMAGE_TAG

# Rename seego's /go_wrapper.sh to /seego.sh for readability in the
# Makefile.
RUN cp /go_wrapper.sh /seego.sh
RUN IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false make agentctl
# RUN cp /go_wrapper.sh /seego.sh
RUN make clean && IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false make agentctl

FROM debian:buster-slim

Expand Down

0 comments on commit e6c5680

Please sign in to comment.