Commit cfccffac authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Create Dockerfile for building

parent 558d625f
Pipeline #9935 passed with stage
in 47 seconds
FROM debian:jessie
RUN apt-get update && \
apt-get install -y \
gcc \
make \
binutils \
libmicrohttpd-dev \
libjansson-dev \
libcurl4-gnutls-dev \
libgnutls28-dev \
libgcrypt20-dev \
libcryptsetup-dev
ENV LD_LIBRARY_PATH="/cryptops-api/libraries"
WORKDIR /cryptops-api
COPY . ./
CMD ["make"]
...@@ -5,3 +5,23 @@ All documentation can be found on ...@@ -5,3 +5,23 @@ All documentation can be found on
In particular, please read the In particular, please read the
[security considerations](https://cryptops.com/considerations.html). [security considerations](https://cryptops.com/considerations.html).
## Building
docker is used for containerised building.
To build the project, first build the docker image:
```shell
docker build -t cryptops-build .
```
Then run the container to perform the build process:
```shell
docker run --name cryptops-build cryptops-build
```
Finally, copy the created binary from the container:
```shell
mkdir -p ./bin
docker cp cryptops-build:/cryptops-api/bin/cryptops-api ./bin/
```
This binary `cryptops-api`, together with the libraries in `./libraries/`, need to be added to your initrd.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/jessie64"
config.vm.synced_folder ".", "/cryptops-api", type: 'virtualbox'
# If cryptops-client directory exists, mount it as well so you can test easier
if File.directory?(File.expand_path('../cryptops-client'))
config.vm.synced_folder "../cryptops-client", "/cryptops-client", type: 'virtualbox'
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y libmicrohttpd-dev libjansson-dev libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libcryptsetup-dev
if ! grep -q 'export LD_LIBRARY_PATH="/cryptops-api/libraries"' /home/vagrant/.bashrc ; then
echo export LD_LIBRARY_PATH="/cryptops-api/libraries">> /home/vagrant/.bashrc
fi
SHELL
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment