Skip to content

Commit a1aea00

Browse files
committed
refactor: improve docker image and speed up openssl build
1 parent e344a98 commit a1aea00

File tree

8 files changed

+14
-263
lines changed

8 files changed

+14
-263
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!docker
3+
!Makefile

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ steps:
6161
password:
6262
from_secret: dockerhub_password
6363
build_args:
64-
- DOCKER_IMAGE_VERSION=${DRONE_TAG}
64+
- VERSION=${DRONE_TAG##v}
6565
auto_tag: true
6666
auto_tag_aliases:
6767
- latest

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@ ci-test:
2525
@du -sh tests/hello-world/target/x86_64-apple-darwin/release/helloworld
2626
.ONESHELL: ci-test
2727

28-
release:
29-
# 1. Update docker files to latest tag
30-
./docker/version.sh $(TAG)
31-
32-
# 2. Commit and push to latest tag
33-
git add .
34-
git commit . -m "$(TAG)"
35-
git tag $(TAG)
36-
git push origin master
37-
git push origin $(TAG)
38-
.ONESHELL: release
39-
4028
promote:
4129
@drone build promote joseluisq/rust-linux-darwin-builder $(BUILD) $(ENV)
4230
.PHONY: promote

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ CXX=o64-clang++ \
139139
cargo build --target x86_64-apple-darwin
140140
```
141141

142-
Read more details about it take a look at [Cross compiling Rust from Linux to macOS](https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html) by James Waples.
142+
For more details take a look at [Cross compiling Rust from Linux to macOS](https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html) by James Waples.
143143

144144
## Contributions
145145

docker/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ FROM debian:buster-slim
55

66
LABEL maintainer="Jose Quintana <git.io/joseluisq>"
77

8-
# The Rust toolchain to use when building our image. Set by `hooks/build`.
9-
ARG TOOLCHAIN=stable
8+
ARG VERSION=0.0.0
9+
ENV VERSION=${VERSION}
10+
1011

12+
# Rust stable toolchain
13+
ARG TOOLCHAIN=stable
1114

1215
# Dependencies
1316

@@ -114,9 +117,9 @@ RUN set -eux \
114117
&& cd "openssl-${OPENSSL_VERSION}" \
115118
&& env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY linux-x86_64 \
116119
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make depend \
117-
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make \
118-
&& make install_sw \
119-
&& make install_ssldirs \
120+
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make -j8 \
121+
&& make -j8 install_sw \
122+
&& make -j8 install_ssldirs \
120123
&& rm /usr/local/musl/include/linux /usr/local/musl/include/asm /usr/local/musl/include/asm-generic \
121124
&& openssl version \
122125
&& rm -r /tmp/* \
@@ -198,5 +201,5 @@ LABEL org.opencontainers.image.vendor="Jose Quintana" \
198201
org.opencontainers.image.url="https://github.com/joseluisq/rust-linux-darwin-builder" \
199202
org.opencontainers.image.title="Rust Linux / Darwin Builder" \
200203
org.opencontainers.image.description="Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross)." \
201-
org.opencontainers.image.version="v1.50.0" \
204+
org.opencontainers.image.version="$VERSION" \
202205
org.opencontainers.image.documentation="https://github.com/joseluisq/rust-linux-darwin-builder"

docker/tmpl.Dockerfile

Lines changed: 0 additions & 201 deletions
This file was deleted.

docker/version.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)