Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Issue #93: Dockerfile and instructions for reproducing binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
bpicode committed Oct 30, 2017
1 parent 1912055 commit a3c16fb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ _testmain.go
*.prof

# build folder
build
/build

# IDE settings
.idea
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,23 @@ func main() {
}
```

## Reproducing binaries

Versions >= 1.4.16 can be checked for reproducibility. There is a ready-to-go [Dockerfile](docker/build/Dockerfile)
which prepares an appropriate environment given several docker build-args
```bash
docker build -t fritzctl/build docker/build \
--build-arg go_version=1.9.2 \
--build-arg fritzctl_version=1.4.16 \
--build-arg fritzctl_revision=v1.4.16
```
Building the binaries is done in the container phase:
```bash
docker run --rm -v fritzctl_build_folder:/root/go/src/github.com/bpicode/fritzctl/build fritzctl/build
```
The above command will create a docker volume `fritzctl_build_folder` containing the binaries. Those can be checked for
equality with the distributed ones.

## License

This project is licensed under the terms of the MIT license, see [LICENSE](https://github.com/bpicode/fritzctl/blob/master/LICENSE).
Expand Down
24 changes: 24 additions & 0 deletions docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:xenial

ARG go_version=1.9.2
ARG fritzctl_revision=master
ARG fritzctl_version=unknown

RUN apt-get update && apt-get install -y make wget git
RUN wget --quiet https://storage.googleapis.com/golang/go${go_version}.linux-amd64.tar.gz
RUN tar -xf go${go_version}.linux-amd64.tar.gz
RUN mv go /usr/local
RUN mkdir -p /root/go/src/github.com/bpicode

WORKDIR /root/go/src/github.com/bpicode
RUN git clone https://github.com/bpicode/fritzctl.git
WORKDIR /root/go/src/github.com/bpicode/fritzctl
RUN git checkout ${fritzctl_revision}
RUN mkdir build

ENV GOPATH=/root/go
ENV GOROOT=/usr/local/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
ENV FRITZCTL_VERSION=$fritzctl_version

ENTRYPOINT [ "make", "sysinfo", "deps", "dist_all"]

0 comments on commit a3c16fb

Please sign in to comment.