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
bf1c9669
Commit
bf1c9669
authored
6 years ago
by
Miroslav Prasil
Browse files
Options
Downloads
Patches
Plain Diff
Update dockerfile for alpine, armv7 and aarch64
parent
8b3e87cf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile.aarch64
+2
-16
2 additions, 16 deletions
Dockerfile.aarch64
Dockerfile.alpine
+4
-15
4 additions, 15 deletions
Dockerfile.alpine
Dockerfile.armv7
+2
-16
2 additions, 16 deletions
Dockerfile.armv7
with
8 additions
and
47 deletions
Dockerfile.aarch64
+
2
−
16
View file @
bf1c9669
...
@@ -39,15 +39,8 @@ RUN apt-get update \
...
@@ -39,15 +39,8 @@ RUN apt-get update \
ENV CARGO_HOME "/root/.cargo"
ENV CARGO_HOME "/root/.cargo"
ENV USER "root"
ENV USER "root"
# Creates a dummy project used to grab dependencies
RUN USER=root cargo new --bin app
WORKDIR /app
WORKDIR /app
# Copies over *only* your manifests and vendored dependencies
COPY ./Cargo.* ./
COPY ./libs ./libs
COPY ./rust-toolchain ./rust-toolchain
# Prepare openssl arm64 libs
# Prepare openssl arm64 libs
RUN sed 's/^deb/deb-src/' /etc/apt/sources.list > \
RUN sed 's/^deb/deb-src/' /etc/apt/sources.list > \
/etc/apt/sources.list.d/deb-src.list \
/etc/apt/sources.list.d/deb-src.list \
...
@@ -62,19 +55,12 @@ ENV CROSS_COMPILE="1"
...
@@ -62,19 +55,12 @@ ENV CROSS_COMPILE="1"
ENV OPENSSL_INCLUDE_DIR="/usr/include/aarch64-linux-gnu"
ENV OPENSSL_INCLUDE_DIR="/usr/include/aarch64-linux-gnu"
ENV OPENSSL_LIB_DIR="/usr/lib/aarch64-linux-gnu"
ENV OPENSSL_LIB_DIR="/usr/lib/aarch64-linux-gnu"
# Builds your dependencies and removes the
# dummy project, except the target folder
# This folder contains the compiled dependencies
RUN rustup target add aarch64-unknown-linux-gnu
RUN cargo build --release --target=aarch64-unknown-linux-gnu -v
RUN find . -not -path "./target*" -delete
# Copies the complete project
# Copies the complete project
# To avoid copying unneeded files, use .dockerignore
# To avoid copying unneeded files, use .dockerignore
COPY . .
COPY . .
# Build
s again, this time it'll just be
# Build
# your actual source files being built
RUN rustup target add aarch64-unknown-linux-gnu
RUN cargo build --release --target=aarch64-unknown-linux-gnu -v
RUN cargo build --release --target=aarch64-unknown-linux-gnu -v
######################## RUNTIME IMAGE ########################
######################## RUNTIME IMAGE ########################
...
...
This diff is collapsed.
Click to expand it.
Dockerfile.alpine
+
4
−
15
View file @
bf1c9669
...
@@ -26,28 +26,17 @@ RUN npm run dist \
...
@@ -26,28 +26,17 @@ RUN npm run dist \
########################## BUILD IMAGE ##########################
########################## BUILD IMAGE ##########################
# Musl build image for statically compiled binary
# Musl build image for statically compiled binary
FROM clux/muslrust:nightly-2018-
08-24
as build
FROM clux/muslrust:nightly-2018-
10-03
as build
# Creates a dummy project used to grab dependencies
ENV USER "root"
RUN USER=root cargo init --bin
# Copies over *only* your manifests and vendored dependencies
WORKDIR /app
COPY ./Cargo.* ./
COPY ./libs ./libs
COPY ./rust-toolchain ./rust-toolchain
# Builds your dependencies and removes the
# dummy project, except the target folder
# This folder contains the compiled dependencies
RUN cargo build --release
RUN find . -not -path "./target*" -delete
# Copies the complete project
# Copies the complete project
# To avoid copying unneeded files, use .dockerignore
# To avoid copying unneeded files, use .dockerignore
COPY . .
COPY . .
# Builds again, this time it'll just be
# Build
# your actual source files being built
RUN cargo build --release
RUN cargo build --release
######################## RUNTIME IMAGE ########################
######################## RUNTIME IMAGE ########################
...
...
This diff is collapsed.
Click to expand it.
Dockerfile.armv7
+
2
−
16
View file @
bf1c9669
...
@@ -39,15 +39,8 @@ RUN apt-get update \
...
@@ -39,15 +39,8 @@ RUN apt-get update \
ENV CARGO_HOME "/root/.cargo"
ENV CARGO_HOME "/root/.cargo"
ENV USER "root"
ENV USER "root"
# Creates a dummy project used to grab dependencies
RUN USER=root cargo new --bin app
WORKDIR /app
WORKDIR /app
# Copies over *only* your manifests and vendored dependencies
COPY ./Cargo.* ./
COPY ./libs ./libs
COPY ./rust-toolchain ./rust-toolchain
# Prepare openssl armhf libs
# Prepare openssl armhf libs
RUN sed 's/^deb/deb-src/' /etc/apt/sources.list > \
RUN sed 's/^deb/deb-src/' /etc/apt/sources.list > \
/etc/apt/sources.list.d/deb-src.list \
/etc/apt/sources.list.d/deb-src.list \
...
@@ -62,19 +55,12 @@ ENV CROSS_COMPILE="1"
...
@@ -62,19 +55,12 @@ ENV CROSS_COMPILE="1"
ENV OPENSSL_INCLUDE_DIR="/usr/include/arm-linux-gnueabihf"
ENV OPENSSL_INCLUDE_DIR="/usr/include/arm-linux-gnueabihf"
ENV OPENSSL_LIB_DIR="/usr/lib/arm-linux-gnueabihf"
ENV OPENSSL_LIB_DIR="/usr/lib/arm-linux-gnueabihf"
# Builds your dependencies and removes the
# dummy project, except the target folder
# This folder contains the compiled dependencies
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN cargo build --release --target=armv7-unknown-linux-gnueabihf -v
RUN find . -not -path "./target*" -delete
# Copies the complete project
# Copies the complete project
# To avoid copying unneeded files, use .dockerignore
# To avoid copying unneeded files, use .dockerignore
COPY . .
COPY . .
# Build
s again, this time it'll just be
# Build
# your actual source files being built
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN cargo build --release --target=armv7-unknown-linux-gnueabihf -v
RUN cargo build --release --target=armv7-unknown-linux-gnueabihf -v
######################## RUNTIME IMAGE ########################
######################## RUNTIME IMAGE ########################
...
...
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