Skip to content

Commit

Permalink
Add Dockerfile for containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaccha committed Apr 18, 2024
1 parent 8a37292 commit 461c39f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ignore everything
**

# except
!src
!tests
!Cargo.lock
!Cargo.toml
!LICENSE
!README.md
27 changes: 27 additions & 0 deletions .github/workflows/build_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,30 @@ jobs:
file: tataki
asset_name: tataki-${{ matrix.name }}

deploy_ghcr:
needs: [create_release]
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/tataki:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/tataki:latest
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:bookworm-slim


LABEL org.opencontainers.image.authors="Tazro Ohta ([email protected])"
LABEL org.opencontainers.image.url="https://github.com/sapporo-wes/tataki"
LABEL org.opencontainers.image.version="v0.2.2"
LABEL org.opencontainers.image.licenses="Apache2.0"
LABEL org.opencontainers.image.description="CLI tool designed primarily for detecting file formats in the bio-science field"

RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends\
curl \
ca-certificates \
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL -o /tmp/docker.tgz https://download.docker.com/linux/static/stable/$(uname -m)/docker-24.0.9.tgz && \
tar -C /tmp -xf /tmp/docker.tgz && \
mv /tmp/docker/* /usr/bin/ && \
rm -rf /tmp/docker /tmp/docker.tgz

ADD https://github.com/sapporo-wes/tataki/releases/latest/download/tataki /usr/bin/tataki
RUN chmod +x /usr/bin/tataki

WORKDIR /app

ENTRYPOINT [ "tataki" ]
CMD [ "--help" ]

0 comments on commit 461c39f

Please sign in to comment.