Added dockerfile
Some checks reported warnings
Rust-build / build (push) Has been cancelled

This commit is contained in:
Justine Pelletreau 2023-07-22 19:44:50 +02:00
parent 3a34230b0a
commit c51d855d9c
2 changed files with 36 additions and 0 deletions

View File

@ -47,3 +47,29 @@ jobs:
- name: Build - name: Build
run: cargo build --release run: cargo build --release
- name: Build
run: cargo build --release
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to registry
uses: docker/login-action@v2
with:
registry: gitea.squi.fr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
env:
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: gitea.squi.fr/justine/portnut:latest

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM rust:slim-buster
RUN mkdir -p /opt/portnut
COPY --chown=root --chmod=0755 ./src /opt/portnut/src
COPY --chown=root --chmod=0755 ./Cargo.toml /opt/portnut/Cargo.toml
RUN apt update
RUN apt install libssl-dev openssl pkg-config -y
WORKDIR /opt/portnut
RUN cargo build --release
RUN cp target/release/portnut /bin/portnut
CMD ["/bin/portnut"]