Docker build from source

Hi!
Having trouble compiling lora-app-server from source.
First source code cloned:
$ git clone git clone https://github.com/brocaar/lora-app-server.git
$ cd lora-app-server
Then I set dockerfile: Dockerfile in docker-compose.yml and finally:
$ docker-compose up
So here what I got:

$ docker-compose up
Pulling postgres (postgres:9.6-alpine)...
9.6-alpine: Pulling from library/postgres
4fe2ade4980c: Pull complete
08cf8c12f47e: Pull complete
451b995b6a91: Pull complete
eb5c502a4ec2: Pull complete
2d1fdd7652e2: Pull complete
ec9d9a649f3c: Pull complete
4b2754939e9d: Pull complete
a3e76355a10e: Pull complete
a8839f4153ad: Pull complete
Pulling redis (redis:4-alpine)...
4-alpine: Pulling from library/redis
4fe2ade4980c: Already exists
fb758dc2e038: Pull complete
989f7b0c858b: Pull complete
d5318f13abaa: Pull complete
3521559474dd: Pull complete
add04b113886: Pull complete
Pulling mosquitto (eclipse-mosquitto:)...
latest: Pulling from library/eclipse-mosquitto
4fe2ade4980c: Already exists
9ed5ccc7b14f: Pull complete
848281416363: Pull complete
Building appserver
Step 1/20 : FROM golang:1.11-alpine AS development
1.11-alpine: Pulling from library/golang
4fe2ade4980c: Already exists
2e793f0ebe8a: Pull complete
77995fba1918: Pull complete
cacfaec3bb6b: Pull complete
885a921d7cd2: Pull complete
Digest: sha256:e7462ca504afc789d289f2bb5fd471815cc11833439d2fe4e61915b190045359
Status: Downloaded newer image for golang:1.11-alpine
 ---> 57915f96905a
Step 2/20 : ENV PROJECT_PATH=/go/src/github.com/brocaar/lora-app-server
 ---> Running in 5936ad91c0ec
Removing intermediate container 5936ad91c0ec
 ---> afabfc890b52
Step 3/20 : ENV PATH=$PATH:$PROJECT_PATH/build
 ---> Running in 3683b97ab589
Removing intermediate container 3683b97ab589
 ---> a92397abfd06
Step 4/20 : ENV CGO_ENABLED=0
 ---> Running in 85d9c54d3e4e
Removing intermediate container 85d9c54d3e4e
 ---> d43d2c0da0df
Step 5/20 : ENV GO_EXTRA_BUILD_ARGS="-a -installsuffix cgo"
 ---> Running in 6e7bb61b3fe7
Removing intermediate container 6e7bb61b3fe7
 ---> 1d11fdfcfe91
Step 6/20 : RUN apk add --no-cache ca-certificates make git bash protobuf alpine-sdk nodejs nodejs-npm
 ---> Running in 9fa84b2d4c33
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/51) Installing fakeroot (1.22-r0)
(2/51) Installing sudo (1.8.23-r2)
(3/51) Installing libcap (2.25-r1)
(4/51) Installing pax-utils (1.2.3-r0)
(5/51) Installing libressl (2.7.4-r0)
(6/51) Installing libattr (2.4.47-r7)
(7/51) Installing attr (2.4.47-r7)
(8/51) Installing tar (1.30-r0)
(9/51) Installing pkgconf (1.5.3-r0)
(10/51) Installing patch (2.7.6-r2)
(11/51) Installing libgcc (6.4.0-r9)
(12/51) Installing libstdc++ (6.4.0-r9)
(13/51) Installing lzip (1.20-r0)
(14/51) Installing nghttp2-libs (1.32.0-r0)
(15/51) Installing libssh2 (1.8.0-r3)
(16/51) Installing libcurl (7.61.1-r1)
(17/51) Installing curl (7.61.1-r1)
(18/51) Installing abuild (3.2.0-r0)
Executing abuild-3.2.0-r0.pre-install
(19/51) Installing binutils (2.30-r5)
(20/51) Installing libmagic (5.32-r0)
(21/51) Installing file (5.32-r0)
(22/51) Installing gmp (6.1.2-r1)
(23/51) Installing isl (0.18-r0)
(24/51) Installing libgomp (6.4.0-r9)
(25/51) Installing libatomic (6.4.0-r9)
(26/51) Installing mpfr3 (3.1.5-r1)
(27/51) Installing mpc1 (1.0.3-r1)
(28/51) Installing gcc (6.4.0-r9)
(29/51) Installing musl-dev (1.1.19-r10)
(30/51) Installing libc-dev (0.7.1-r0)
(31/51) Installing g++ (6.4.0-r9)
(32/51) Installing make (4.2.1-r2)
(33/51) Installing fortify-headers (0.9-r0)
(34/51) Installing build-base (0.5-r1)
(35/51) Installing expat (2.2.5-r0)
(36/51) Installing pcre2 (10.31-r0)
(37/51) Installing git (2.18.1-r0)
(38/51) Installing alpine-sdk (1.0-r0)
(39/51) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(40/51) Installing ncurses-terminfo (6.1_p20180818-r1)
(41/51) Installing ncurses-libs (6.1_p20180818-r1)
(42/51) Installing readline (7.0.003-r0)
(43/51) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(44/51) Installing c-ares (1.14.0-r0)
(45/51) Installing libcrypto1.0 (1.0.2p-r0)
(46/51) Installing http-parser (2.8.1-r0)
(47/51) Installing libssl1.0 (1.0.2p-r0)
(48/51) Installing libuv (1.20.2-r0)
(49/51) Installing nodejs (8.11.4-r0)
(50/51) Installing npm (8.11.4-r0)
(51/51) Installing protobuf (3.5.2-r0)
Executing busybox-1.28.4-r1.trigger
OK: 251 MiB in 65 packages
Removing intermediate container 9fa84b2d4c33
 ---> e11d2a2945ac
Step 7/20 : RUN mkdir -p $PROJECT_PATH
 ---> Running in e6154a0e544e
Removing intermediate container e6154a0e544e
 ---> 3c9b7e30be45
Step 8/20 : COPY . $PROJECT_PATH
 ---> f46ea3b242c9
Step 9/20 : WORKDIR $PROJECT_PATH
 ---> Running in c2d76202e1e9
Removing intermediate container c2d76202e1e9
 ---> 9952c908bf57
Step 10/20 : RUN mkdir -p /etc/lora-app-server/certs
 ---> Running in 9af23dcc09ed
Removing intermediate container 9af23dcc09ed
 ---> 8bc0fb841390
Step 11/20 : RUN openssl req -x509 -newkey rsa:4096 -keyout /etc/lora-app-server/certs/http-key.pem -out /etc/lora-app-server/certs/http.pem -days 365 -nodes -batch -subj "/CN=localhost"
 ---> Running in 83cedc226090
Generating a 4096 bit RSA private key
.............................................................................................++
..............................................................++
writing new private key to '/etc/lora-app-server/certs/http-key.pem'
-----
Removing intermediate container 83cedc226090
 ---> 2829706cfbf1
Step 12/20 : RUN make dev-requirements requirements ui-requirements
 ---> Running in aa468ba5beae
go get -u golang.org/x/lint/golint
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/elazarl/go-bindata-assetfs/...
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/kisielk/errcheck
go get -u github.com/smartystreets/goconvey
go get -u golang.org/x/tools/cmd/stringer
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/goreleaser/goreleaser
go get -u github.com/goreleaser/nfpm
dep ensure -v
(1/59) Wrote gopkg.in/yaml.v2@v2.2.1
(2/59) Wrote github.com/elazarl/go-bindata-assetfs@master
(3/59) Wrote github.com/gomodule/redigo@v2.0.0
(4/59) Wrote github.com/gorilla/context@v1.1.1
(5/59) Wrote github.com/fsnotify/fsnotify@v1.4.7
(6/59) Wrote cloud.google.com/go@v0.25.0
(7/59) Wrote github.com/gopherjs/gopherjs@master
(8/59) Wrote github.com/googleapis/gax-go@v2.0.0
(9/59) Wrote contrib.go.opencensus.io/exporter/stackdriver@v0.6.0
(10/59) Wrote github.com/brocaar/lorawan@master
(11/59) Wrote github.com/davecgh/go-spew@v1.1.1
(12/59) Wrote github.com/brocaar/loraserver@master
(13/59) Wrote github.com/dgrijalva/jwt-go@v3.2.0
(14/59) Wrote github.com/eclipse/paho.mqtt.golang@master
(15/59) Wrote github.com/gofrs/uuid@master
(16/59) Wrote github.com/NickBall/go-aes-key-wrap@master
(17/59) Wrote github.com/gorilla/mux@v1.6.2
(18/59) Wrote github.com/golang/protobuf@v1.2.0
(19/59) Wrote github.com/gorilla/websocket@v1.4.0
(20/59) Wrote github.com/inconshreveable/mousetrap@v1.0
(21/59) Wrote github.com/hashicorp/hcl@v1.0.0
(22/59) Wrote github.com/grpc-ecosystem/grpc-gateway@v1.5.0
(23/59) Wrote github.com/grpc-ecosystem/go-grpc-middleware@master
(24/59) Wrote github.com/jacobsa/crypto@master
(25/59) Wrote github.com/jmoiron/sqlx@master
(26/59) Wrote github.com/jtolds/gls@v4.2.1
(27/59) Wrote github.com/lib/pq@master
(28/59) Wrote github.com/magiconair/properties@v1.8.0
(29/59) Wrote github.com/mitchellh/mapstructure@v1.0.0
(30/59) Wrote github.com/mmcloughlin/geohash@master
(31/59) Wrote github.com/pelletier/go-toml@v1.2.0
(32/59) Wrote github.com/pkg/errors@v0.8.0
(33/59) Wrote github.com/pmezard/go-difflib@v1.0.0
(34/59) Wrote github.com/rubenv/sql-migrate@master
(35/59) Wrote github.com/robertkrimen/otto@master
(36/59) Wrote github.com/sirupsen/logrus@v1.0.6
(37/59) Wrote github.com/smartystreets/assertions@1.8.3
(38/59) Wrote github.com/spf13/afero@v1.1.2
(39/59) Wrote github.com/smartystreets/goconvey@1.6.3
(40/59) Wrote github.com/spf13/cast@v1.2.0
(41/59) Wrote github.com/spf13/cobra@master
(42/59) Wrote github.com/spf13/jwalterweatherman@v1.0.0
(43/59) Wrote github.com/spf13/pflag@v1.0.2
(44/59) Wrote github.com/spf13/viper@master
(45/59) Wrote github.com/tmc/grpc-websocket-proxy@master
(46/59) Wrote github.com/stretchr/testify@v1.2.2
(47/59) Wrote golang.org/x/crypto@master
(48/59) Wrote golang.org/x/sync@master
(49/59) Wrote golang.org/x/oauth2@master
(50/59) Wrote go.opencensus.io@v0.17.0
(51/59) Wrote gopkg.in/sourcemap.v1@v1.0.5
(52/59) Wrote google.golang.org/appengine@v1.1.0
(53/59) Wrote gopkg.in/gorp.v1@v1.7.1
(54/59) Wrote golang.org/x/net@master
(55/59) Wrote golang.org/x/sys@master
(56/59) Wrote google.golang.org/grpc@v1.15.0
(57/59) Wrote google.golang.org/genproto@master
(58/59) Wrote golang.org/x/text@v0.3.0
(59/59) Wrote google.golang.org/api@master
Installing UI requirements

> jss@9.8.7 postinstall /go/src/github.com/brocaar/lora-app-server/ui/node_modules/jss
> node -e "console.log('\u001b[35m\u001b[1mLove JSS? You can now support us on open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/jss/donate\u001b[0m')"

Love JSS? You can now support us on open collective:
 > https://opencollective.com/jss/donate
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1830 packages in 67.215s
Removing intermediate container aa468ba5beae
 ---> a2256db60204
Step 13/20 : RUN make
 ---> Running in 124d0c2f13fc
Building ui

> lora-app-server-ui@2.3.0 build /go/src/github.com/brocaar/lora-app-server/ui
> react-scripts build

Creating an optimized production build...
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lora-app-server-ui@2.3.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lora-app-server-ui@2.3.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-18T19_37_30_955Z-debug.log
make: *** [Makefile:37: ui/build] Error 1
ERROR: Service 'appserver' failed to build: The command '/bin/sh -c make' returned a non-zero code: 2

Hi almaz,

I have no idea if the question is still current, but had the same problem and fixed it by doing a “npm install” in ui folder.
After that I could build the app server without further problems.