Skip to content

Commit

Permalink
refactor(docker): use minimal docker for image publish
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Jan 9, 2025
1 parent 35fd1ea commit a09c70f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: Check-out code
uses: actions/checkout@v2
- name: Build image
run: docker build -t agent .
run: docker build -f integration-tests/Dockerfile -t agent .
- name: Run tests
run: docker run -v $PWD:/agent agent ./tests.sh
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 = "pyth-agent"
version = "2.12.0"
version = "2.12.1"
edition = "2021"

[[bin]]
Expand Down
26 changes: 11 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
FROM python:3.10-slim-bullseye
FROM rust:slim-bookworm as builder

# Install Rust
RUN apt update && apt install -y curl pkg-config libssl-dev build-essential
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup toolchain install nightly

# Install poetry
RUN pip install poetry
ENV PATH="${PATH}:/root/.local/bin"
RUN poetry config virtualenvs.in-project true

# Install Solana Tool Suite
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)"
ENV PATH="${PATH}:/root/.local/share/solana/install/active_release/bin"
RUN apt update && apt install -y curl libssl-dev pkg-config && apt clean all

ADD . /agent
WORKDIR /agent

RUN cargo build --release

FROM debian:12-slim

RUN apt update && apt install -y libssl-dev && apt clean all

COPY --from=builder /agent/target/release/agent /agent/
COPY --from=builder /agent/config/* /agent/config/

ENTRYPOINT ["/agent/agent"]
17 changes: 0 additions & 17 deletions agent.Dockerfile

This file was deleted.

0 comments on commit a09c70f

Please sign in to comment.