-
Notifications
You must be signed in to change notification settings - Fork 0
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 Containerfile #16
Conversation
Dockerfile
Outdated
COPY .cargo . | ||
COPY Cargo* ./ | ||
COPY src src/ | ||
|
||
RUN cargo build --release --locked --target=x86_64-unknown-linux-musl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can cache the dependencies with a trick
Copy Cargo*
first, then create a dummy lib.rs
file:
RUN mkdir -p src && touch src/lib.rs && cargo build --release --locked --target=x86_64-unknown-linux-musl
then copy src and run the build again.
For the CI it shouldn't matter, but for local testing it would probably speed up things considerably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does help.
Changed in 33320ee
.github/workflows/main.yaml
Outdated
docker-build: | ||
name: Build the Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker build . --file Dockerfile --tag pod-director:$(date +%s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question. Would we like to be petty and adopt the "Containerfile" and "container image" terms instead?
Ubuntu uses it in its documentation: https://manpages.ubuntu.com/manpages/jammy/en/man5/containers-dockerfile.5.html
I'll let you decide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we would!
Although 'Dockerfile' is the industry standard, using a more generic name would be better.
Changed in 3368c8c
No description provided.