Skip to content
Closed
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
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,44 @@ jobs:
- name: Cargo publish
run: cargo publish
shell: bash
docker-image:
name: Build and push docker images
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: lowercase repository owner
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>$GITHUB_ENV
- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Build and push (tag)
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
push: true
tags: ghcr.io/${{ env.OWNER }}/bindle:latest,ghcr.io/${{ env.OWNER }}/bindle:${{ env.RELEASE_VERSION }}

- name: Build and push (main)
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main'
with:
push: true
tags: ghcr.io/${{ env.OWNER }}/bindle:canary
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bindle"
version = "0.8.0"
version = "0.8.3"
authors = [
"Matt Butcher <matt.butcher@microsoft.com>",
"Taylor Thomas <taylor.thomas@microsoft.com>"
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM rust:1.64 as builder

WORKDIR /app
COPY . /app
RUN cargo build --release --all-features --bin bindle-server

FROM debian:bullseye-slim

ARG USERNAME=bindle
ARG USER_UID=1000
ARG USER_GID=$USER_UID

VOLUME [ "/bindle-data" ]

ENV BINDLE_IP_ADDRESS_PORT="0.0.0.0:8080"
ENV BINDLE_DIRECTORY="/bindle-data/bindles"

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

COPY --from=builder --chown=$USERNAME /app/target/release/bindle-server /usr/local/bin/bindle-server

USER $USERNAME
CMD ["/usr/local/bin/bindle-server", "--unauthenticated"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ build-client:

$(CERT_NAME).crt.pem:
openssl req -newkey rsa:2048 -nodes -keyout $(CERT_NAME).key.pem -x509 -days 365 -out $(CERT_NAME).crt.pem

.PHONY: build-docker-image
build-docker-image:
docker build -t fermyon/bindle:dev .