-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from cvent/add-docker
Add docker support
- Loading branch information
Showing
7 changed files
with
67 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
name = "hogan" | ||
version = "0.2.2" | ||
authors = ["Jonathan Morley <[email protected]>"] | ||
build = "build.rs" | ||
|
||
[[bin]] | ||
name = "hogan" | ||
|
@@ -28,9 +27,3 @@ tempfile = "3.0" | |
url = "1.7" | ||
walkdir = "2.0" | ||
zip = "0.3.2" | ||
|
||
[build-dependencies] | ||
skeptic = "0.13" | ||
|
||
[dev-dependencies] | ||
skeptic = "0.13" |
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,46 @@ | ||
# We need to use the Rust build image, because | ||
# we need the Rust compile and Cargo tooling | ||
FROM clux/muslrust:stable as build | ||
|
||
# Install cmake as it is not included in muslrust, but is needed by libssh2-sys | ||
RUN apt-get update && apt-get install -y \ | ||
cmake \ | ||
--no-install-recommends && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
# Creates a dummy project used to grab dependencies | ||
RUN USER=root cargo init --bin | ||
|
||
# Copies over *only* your manifests | ||
COPY ./Cargo.* ./ | ||
|
||
# Builds your dependencies and removes the | ||
# fake source code from the dummy project | ||
RUN cargo build --release | ||
RUN rm src/*.rs | ||
RUN rm target/x86_64-unknown-linux-musl/release/hogan | ||
|
||
# Copies only your actual source code to | ||
# avoid invalidating the cache at all | ||
COPY ./src ./src | ||
|
||
# Builds again, this time it'll just be | ||
# your actual source files being built | ||
RUN cargo build --release | ||
|
||
FROM alpine:latest as certs | ||
RUN apk --update add ca-certificates | ||
|
||
# Create a new stage with a minimal image | ||
# because we already have a binary built | ||
FROM scratch | ||
|
||
# Copies standard SSL certs from the "build" stage | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
# Copies the binary from the "build" stage | ||
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/hogan /bin/ | ||
|
||
# Configures the startup! | ||
ENTRYPOINT ["/bin/hogan"] |
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
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
This file was deleted.
Oops, something went wrong.