diff --git a/backend/Dockerfile b/backend/Dockerfile index ed5a9c0548..5bddcf8e3a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,14 +1,30 @@ -FROM golang:1.10.2-stretch +FROM golang:1.10.2 ENV SCOPE_SKIP_UI_ASSETS true -RUN apt-get update && \ - apt-get install -y libpcap-dev time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential python-pip && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN set -eux; \ + export arch_val="$(dpkg --print-architecture)"; \ + apt-get update && \ + if [ "$arch_val" = "amd64" ]; then \ + apt-get install -y libpcap-dev python-requests time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential python-pip; \ + else \ + apt-get install -y libpcap-dev python-requests time file shellcheck git curl build-essential python-pip; \ + fi; \ + \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + RUN go clean -i net && \ go install -tags netgo std && \ - go install -race -tags netgo std -RUN curl -fsSL -o shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \ - chmod +x shfmt && \ - mv shfmt /usr/bin + export arch_val="$(dpkg --print-architecture)"; \ + if [ "$arch_val" != "ppc64el" ]; then \ + go install -race -tags netgo std; \ + fi; +RUN export arch_val="$(dpkg --print-architecture)"; \ + if [ "$arch_val" = "amd64" ]; then \ + curl -fsSL -o shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \ + chmod +x shfmt && \ + mv shfmt /usr/bin; \ + fi; + # Skipped installing shfmt, as the version v1.3.0 isn't supported for ppc64le + # and the later version of shfmt doesn't work with the application well RUN go get -tags netgo \ github.com/fzipp/gocyclo \ github.com/golang/lint/golint \ diff --git a/client/Dockerfile b/client/Dockerfile index efaf528731..4c19dc2f2b 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,4 +1,4 @@ -FROM node:8.4.0 +FROM node:8.11 WORKDIR /home/weave COPY package.json yarn.lock /home/weave/ ENV NPM_CONFIG_LOGLEVEL=warn NPM_CONFIG_PROGRESS=false diff --git a/docker/Dockerfile.cloud-agent b/docker/Dockerfile.cloud-agent index edf768c862..627fcfa2bc 100644 --- a/docker/Dockerfile.cloud-agent +++ b/docker/Dockerfile.cloud-agent @@ -1,4 +1,4 @@ -FROM alpine:3.5 +FROM alpine:3.7 WORKDIR /home/weave RUN apk add --update bash conntrack-tools iproute2 util-linux curl && \ rm -rf /var/cache/apk/* diff --git a/probe/endpoint/dns_snooper_linux_amd64.go b/probe/endpoint/dns_snooper.go similarity index 98% rename from probe/endpoint/dns_snooper_linux_amd64.go rename to probe/endpoint/dns_snooper.go index a755f364a3..197b838fba 100644 --- a/probe/endpoint/dns_snooper_linux_amd64.go +++ b/probe/endpoint/dns_snooper.go @@ -1,3 +1,7 @@ +// +build linux,amd64 linux,ppc64le + +// Build constraint to use this file for amd64 & ppc64le on Linux + package endpoint import ( diff --git a/probe/process/walker_linux_test.go b/probe/process/walker_linux_test.go index cfa18d8d97..5de6fc9c4d 100644 --- a/probe/process/walker_linux_test.go +++ b/probe/process/walker_linux_test.go @@ -1,6 +1,7 @@ package process_test import ( + "os" "reflect" "testing" @@ -79,9 +80,11 @@ var mockFS = fs.Dir("", func TestWalker(t *testing.T) { fs_hook.Mock(mockFS) defer fs_hook.Restore() + var pageSize uint64 + pageSize = (uint64)(os.Getpagesize() * 2) want := map[int]process.Process{ - 3: {PID: 3, PPID: 2, Name: "curl", Cmdline: "curl google.com", Threads: 1, RSSBytes: 8192, RSSBytesLimit: 2048, OpenFilesCount: 3, OpenFilesLimit: 32768}, + 3: {PID: 3, PPID: 2, Name: "curl", Cmdline: "curl google.com", Threads: 1, RSSBytes: pageSize, RSSBytesLimit: 2048, OpenFilesCount: 3, OpenFilesLimit: 32768}, 2: {PID: 2, PPID: 1, Name: "bash", Cmdline: "bash", Threads: 1, OpenFilesCount: 2}, 4: {PID: 4, PPID: 3, Name: "apache", Cmdline: "apache", Threads: 1, OpenFilesCount: 1}, 1: {PID: 1, PPID: 0, Name: "init", Cmdline: "init", Threads: 1, OpenFilesCount: 0},