Dashboard: Go command error, dev environment in docker failed

Created on 5 Jan 2018  路  5Comments  路  Source: kubernetes/dashboard

Environment
Dashboard version:1.8.0
Kubernetes version:1.9.0
Operating system: docker image golang:latest
Node.js version:v9.3.0
Go version:go version go1.9.2 linux/amd64
Steps to reproduce

$ docker run -p 9090:9090 dashboard /bin/bash
$ gulp serve

Observed result
go build github.com/kubernetes/dashboard/src/app/backend/handler: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
[01:35:46] 'backend' errored after 55 s
[01:35:46] Error: Go command error, code: 1
    at ChildProcess.<anonymous> (/dashboard/build/gocommand.js:191:23)
    at ChildProcess.emit (events.js:159:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)

how to run a dev environment in docker?
docker file:

# golang is based on debian:jessie
FROM golang

# Install Java and Node.js. Go is already installed.
# A small tweak, apt-get update is already run by the nodejs setup script, so there's no need to run it again.
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - \
  && apt-get install -y --no-install-recommends \
    openjdk-8-jre \
    nodejs \
    patch \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

# Download a statically linked docker client, so the container is able to build images on the host.
RUN curl -sSL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/bin/docker && \
    chmod +x /usr/bin/docker

# Current directory is always /dashboard.
WORKDIR /dashboard

# Copy entire source tree.
COPY ./ ./

# Install dependencies. This will take a while.
RUN npm install --unsafe-perm

1core 1Gmemory

Most helpful comment

The cause is that go build is using too much memory, you have to upgrade your memory to 3GB+ to avoid go build process run out of memory.

All 5 comments

@maciaszczykm I think you have worked with our build/Dockerfile. It was used by some gulp task, right?

Use build/run-gulp-in-docker.sh and let us know if it helped.

Ahh... yes. It is described on our wiki how to use it.

Building Dashboard inside a container

The cause is that go build is using too much memory, you have to upgrade your memory to 3GB+ to avoid go build process run out of memory.

@maciaszczykm in China, the docker build command failed because of the network. I solved it. 1core 1Gmemory is not enough

Was this page helpful?
0 / 5 - 0 ratings