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

Add docker build tooling to help build a local set of working libraries #7

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 contrib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BUILD_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
DOCKER := $(shell test -x /usr/bin/podman && echo podman || echo docker)

build-ubuntu: 22.04

18.04 20.04 22.04 24.04:
$(DOCKER) build -f $(BUILD_DIR)/build-ubuntu.Dockerfile --build-arg RELEASE=$@ -t build-awscred-lib .
$(DOCKER) run -ti --rm -v ./:/build build-awscred-lib
28 changes: 28 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Helpers for building s3fs-fuse-awscred-lib

The tools in this directory can be used to build the library locally, so it can either
be installed manually or just used from the current directory.

## Requirements:

- Linux
- Docker, Podman or an alternative container runtime
- GNU Make (optional, read `Makefile` for alternative instructions)

## Usage

The provided `Makefile` currently supports building for the currently supported
Ubuntu LTS versions.

To build all the required binaries, including the test tool, and copy them into the
current directory, run:

`make -f contrib/Makefile [UBUNTU_VERSION]`

where `UBUNTU_VERSION` is optional and can be an LTS version number such as `20.04`.
If not specified, `22.04` is used (which is the current latest LTS release).

After the build is complete, the resulting `.so` files can be manually copied to
someplace in the dynamic linker path (for example `/usr/local/lib`) or can be
loaded directly by setting the environment variable `LD_LIBRARY_PATH` for the
`s3fs` command, e.g. `LD_LIBRARY_PATH=. s3fs …`
25 changes: 25 additions & 0 deletions contrib/build-ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG RELEASE=20.04
FROM ubuntu:$RELEASE
ARG RELEASE=20.04
ENV DEBIAN_FRONTEND=noninteractive
ADD ./ /src/s3fs-fuse-awscred-lib
WORKDIR /src/s3fs-fuse-awscred-lib
RUN .github/workflows/linux-ci-helper.sh ubuntu:${RELEASE}
RUN mkdir -p /src/aws-sdk/sdk_build
WORKDIR /src/aws-sdk
RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
WORKDIR /src/aws-sdk/sdk_build
RUN cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${PWD} -DBUILD_ONLY="core;identity-management" -DAUTORUN_UNIT_TESTS=OFF
RUN make
RUN make install
WORKDIR /src/s3fs-fuse-awscred-lib
RUN cmake -S . -B build
RUN cmake --build build
VOLUME /build
CMD mkdir -p /build && cp /src/s3fs-fuse-awscred-lib/build/libs3fsawscred.so \
/src/s3fs-fuse-awscred-lib/build/s3fsawscred_test \
/usr/local/lib/libaws-cpp-sdk-identity-management.so \
/usr/local/lib/libaws-cpp-sdk-core.so \
/usr/local/lib/libaws-cpp-sdk-cognito-identity.so \
/usr/local/lib/libaws-cpp-sdk-sts.so \
/build
Loading