Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with docker #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
*.o
*.a
/pCloudCC/CMakeCache.txt
/pCloudCC/CMakeFiles/
/pCloudCC/Makefile
/pCloudCC/cmake_install.cmake
/pCloudCC/lib/mbedtls/Makefile
/pCloudCC/lib/mbedtls/library/Makefile
/pCloudCC/libpcloudcc_lib.so
/pCloudCC/pcloudcc
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ On Ubuntu you can run the following command:
> ldconfig
> pcloudcc -u username -p

## Build with docker
> ./build-with-docker.sh

After that pcloudcc and libpcloudcc_lib.so are located below pCloudCC.

## Usage
Terminal command is pcloudcc and -h option prints short options description.
> ./pcloudcc -h
Expand Down
12 changes: 12 additions & 0 deletions build-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM debian:stretch

RUN apt-get update && \
apt-get install -y g++ cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev git && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /build /work
COPY build.sh /build
RUN chmod 755 /build/build.sh

VOLUME /work
WORKDIR /work
9 changes: 9 additions & 0 deletions build-container/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

BUILD_DIR=/work

cd $BUILD_DIR/pCloudCC/lib/pclsync/ && make clean && make fs

cd $BUILD_DIR/pCloudCC/lib/mbedtls/ && cmake . && make clean && make

cd $BUILD_DIR/pCloudCC/ && cmake . && make
14 changes: 14 additions & 0 deletions build-with-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -e

PROJECT_DIR=$(cd `dirname $0` && pwd)

cd $PROJECT_DIR/build-container

docker build --tag pcloudcc-build:local .

cd $PROJECT_DIR
docker run \
-u $(id -u):$(id -g) \
-v $PROJECT_DIR:/work \
pcloudcc-build:local \
/build/build.sh