diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..285143f0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:3.3 + +ENV MICROMDM_VERSION=v0.1.0.0-dev +RUN apk --no-cache add curl && \ + curl -L https://github.com/micromdm/micromdm/releases/download/${MICROMDM_VERSION}/micromdm-linux-amd64 -o /micromdm && \ + chmod a+x /micromdm && \ + apk del curl + +CMD ["/micromdm"] diff --git a/Dockerfile.dev b/Dockerfile.dev index 6cd844fc..8e16adee 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -15,7 +15,8 @@ RUN mkdir -p /go/src/github.com/micromdm/micromdm/ WORKDIR /go/src/github.com/micromdm/micromdm/ COPY . /go/src/github.com/micromdm/micromdm/ -#RUN glide install +RUN glide install + RUN GOGC=500 go build && mv micromdm / CMD ["/micromdm"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3e826a6c --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +GO := GO15VENDOREXPERIMENT=1 go +glide := glide +release := ./release.sh + +all: build + +deps: + @echo ">> getting dependencies" + @$(glide) install + +build: deps + @echo ">> building binaries" + @$(release) + +docker: + @echo ">> building micromdm-dev docker container" + docker build -f Dockerfile.dev -t micromdm-dev . + diff --git a/README.md b/README.md index d06c248a..d72d0f80 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,15 @@ Installation and configuration instructions will be maintained on the [website]( An administrator can group a DEP enrollment profile, a list of applications and a list of configuration profiles into a workflow and assign the workflow to a device. If a device has an assigned workflow, `micromdm` will configure the device according to the workflow. If you're familiar with Munki's [manifest](https://github.com/munki/munki/wiki/Manifests) feature, workflows work in a similar way. + +# Build instructions +To build the project from source you will need the [`go`](https://golang.org/dl/) and [`glide`](https://github.com/Masterminds/glide) tools, with a valid `GOPATH`. +If you're new to Go see [Writing, building, installing, and testing Go code](https://www.youtube.com/watch?v=XCsL89YtqCs) and [Resources for new Go programmers](http://dave.cheney.net/resources-for-new-go-programmers) to get started. + +* simply run `make` to install a new build. +* `make deps` will install the necessary dependencies. after that you can use `go build`, `go test` etc. +* run `make docker` to build a docker container from the local source. + +If you want to run locally for testing/development, an easy way to run postgres and redis is by using `docker-compose` +`docker-compose -f compose-pg.yml up` + diff --git a/compose-pg.yml b/compose-local.yml similarity index 99% rename from compose-pg.yml rename to compose-local.yml index 37d09779..a8234a13 100644 --- a/compose-pg.yml +++ b/compose-local.yml @@ -14,4 +14,3 @@ postgres: - SSLMODE=disable ports: - "127.0.0.1:5432:5432" - diff --git a/release.sh b/release.sh index ec0df895..c678c95d 100755 --- a/release.sh +++ b/release.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="0.1.0" +VERSION="0.1.0.0-dev" NAME=micromdm echo "Building $NAME version $VERSION"