Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Vaultwarden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Vaultwarden
Commits
346c7630
Commit
346c7630
authored
6 years ago
by
Miroslav Prasil
Browse files
Options
Downloads
Patches
Plain Diff
Initial implementation of musl build on top of Alpine
parent
1c57c9d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+7
-17
7 additions, 17 deletions
Dockerfile
with
7 additions
and
17 deletions
Dockerfile
+
7
−
17
View file @
346c7630
...
...
@@ -25,19 +25,11 @@ RUN npm run dist \
&&
mv
build /web-vault
########################## BUILD IMAGE ##########################
# We need to use the Rust build image, because
# we need the Rust compiler and Cargo tooling
FROM
rust
as
build
# Using bundled SQLite, no need to install it
# RUN apt-get update && apt-get install -y\
# sqlite3\
# --no-install-recommends\
# && rm -rf /var/lib/apt/lists/*
# Musl build image for statically compiled binary
FROM
clux/muslrust:nightly-2018-06-26
as
build
# Creates a dummy project used to grab dependencies
RUN
USER
=
root cargo new
--bin
app
WORKDIR
/app
RUN
USER
=
root cargo init
--bin
# Copies over *only* your manifests and vendored dependencies
COPY
./Cargo.* ./
...
...
@@ -61,17 +53,15 @@ RUN cargo build --release
######################## RUNTIME IMAGE ########################
# Create a new stage with a minimal image
# because we already have a binary built
FROM
debian:stretch-slim
FROM
alpine:3.8
ENV
ROCKET_ENV "staging"
ENV
ROCKET_WORKERS=10
# Install needed libraries
RUN
ap
t-get update
&&
apt-get
install
-y
\
RUN
ap
k add
\
openssl
\
ca-certificates
\
--no-install-recommends
\
&&
rm
-rf
/var/lib/apt/lists/
*
ca-certificates
RUN
mkdir
/data
VOLUME
/data
...
...
@@ -82,7 +72,7 @@ EXPOSE 80
COPY
.env .
COPY
Rocket.toml .
COPY
--from=vault /web-vault ./web-vault
COPY
--from=build
app/target
/release/bitwarden_rs .
COPY
--from=build
/volume/target/x86_64-unknown-linux-musl
/release/bitwarden_rs .
# Configures the startup!
CMD
./bitwarden_rs
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment