1 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml --># Build xds-server from scratch
5 Install [Go](https://golang.org/doc/install), [npm](https://www.npmjs.com/),
6 [nodejs](https://nodejs.org/en/) and some other tools.
8 Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
14 Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-server`
15 in order respect directory hierarchy that match Go package import logic (see
16 [How to Write Go Code](https://golang.org/doc/code.html) for more details).
18 Then use delivered Makefile :
21 # Declare ROOTDIR, can be any location (for example xds-build)
22 ROOTDIR=$HOME/xds-build
24 # Create directory hierarchy that match Go package import logic
25 mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
26 cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
29 git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-server
30 # or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-server
33 # (note that GOPATH will correctly be set by Makefile)
38 Generate xds-server package / tarball
44 And to install `xds-server` (by default in `/opt/AGL/xds/server`):
50 <!-- section-warning -->
53 Makefile install rule and default values in configuration file are set
54 to fit the docker setup.
56 So you may need to adapt some settings when you want to install xds-server natively.
57 <!-- end-section-warning -->
62 Used `DESTDIR` to specify another install directory
65 make install DESTDIR=$HOME/opt/xds-server
68 <!-- end-section-note -->
72 As an alternative to a pre-build image, you can rebuild the container from scratch.
74 `xds-server` has been integrated as a flavour of AGL SDK docker image.
76 So to rebuild docker image just execute following commands:
79 # Clone docker-worker-generator git repo
80 git clone https://git.automotivelinux.org/AGL/docker-worker-generator
81 # Start build that will create a docker image
82 cd docker-worker-generator
83 make build FLAVOUR=xds