-
Notifications
You must be signed in to change notification settings - Fork 40
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
Bring back docker image #1211
Merged
Merged
Bring back docker image #1211
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e3015df
Revert "don't build docker images in CI (#1062)"
david-crespo 491c829
update readme to mention CLI, not console
david-crespo 6d93b65
the obvious thing would be to use install_prereqs.sh directly, but le…
david-crespo f5dc77b
give up, attempt to run install_prerequisites.sh
david-crespo 5a7503f
just for fun, remove sudo from install prereqs script
david-crespo 5a32fa8
also try copying the install step out of the script, but *before* car…
david-crespo b860ad2
Revert "just for fun, remove sudo from install prereqs script"
david-crespo 4bf842c
use prereqs script again, this time with workarounds
david-crespo 8653c2f
try and fix the branch name extractor
david-crespo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# GitHub Actions configuration to automatically build and publish a Docker image | ||
# for Omicron. See README for details. | ||
# | ||
name: docker-image | ||
on: push | ||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
# actions/checkout@v2 | ||
- uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to GitHub Packages Docker Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract branch name | ||
shell: bash | ||
run: BRANCH="${GITHUB_HEAD_REF//\//-}"; echo "::set-output name=branch::${BRANCH:-main}" | ||
id: extract_branch | ||
- name: Build and push | ||
# This pushes a docker image to github's container registry. | ||
# It is not a public image by default. | ||
# The docs are here: https://github.com/docker/build-push-action | ||
uses: docker/build-push-action@9379083e426e2e84abb80c8c091f5cdeb7d3fd7a | ||
with: | ||
push: ${{ ! startsWith(github.ref, 'refs/heads/dependabot') }} | ||
file: ./Dockerfile | ||
tags: ghcr.io/${{ github.repository_owner }}/omicron:${{ steps.extract_branch.outputs.branch }},ghcr.io/${{ github.repository_owner }}/omicron:${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Dockerfile: build a Docker image for Omicron. This is used by the console for | ||
# prototyping and development. This will not be used for deployment to a real | ||
# rack. | ||
# | ||
# ------------------------------------------------------------------------------ | ||
# Cargo Build Stage | ||
# ------------------------------------------------------------------------------ | ||
|
||
FROM rust:latest as cargo-build | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /usr/src/omicron | ||
|
||
COPY . . | ||
|
||
WORKDIR /usr/src/omicron | ||
RUN apt-get update && apt-get install -y \ | ||
libpq-dev \ | ||
pkg-config \ | ||
xmlsec1 \ | ||
libxmlsec1-dev \ | ||
libxmlsec1-openssl \ | ||
libclang-dev \ | ||
libsqlite3-dev \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN cargo build --release | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Final Stage | ||
# ------------------------------------------------------------------------------ | ||
|
||
FROM debian:sid-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
libpq5 \ | ||
libssl1.1 \ | ||
libsqlite3-0 \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
COPY --from=cargo-build /usr/src/omicron/target/release/nexus /usr/bin/nexus | ||
COPY --from=cargo-build /usr/src/omicron/target/release/omicron-dev /usr/bin/omicron-dev | ||
COPY --from=cargo-build /usr/src/omicron/target/release/omicron-package /usr/bin/omicron-package | ||
COPY --from=cargo-build /usr/src/omicron/target/release/sled-agent-sim /usr/bin/sled-agent-sim | ||
|
||
CMD ["sled-agent-sim"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
adding this is the only change from the old Dockerfile