Skip to content

Commit 92f5aa7

Browse files
debrisarkpar
authored andcommitted
improved dockerfile builds (#5659)
* docker builds current branch instead of cloning the repo * moved ADD command right before RUN cd parity in Dockerfiles * update docker/README.md * removed --no-cache from docker/README.md
1 parent f47cbe0 commit 92f5aa7

File tree

11 files changed

+48
-190
lines changed

11 files changed

+48
-190
lines changed

.dockerignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
target
4+
5+
*.swp
6+
*.swo
7+
*.swn
8+
*.DS_Store
9+
10+
# Visual Studio Code stuff
11+
.vscode
12+
13+
# GitEye stuff
14+
.project
15+
16+
# idea ide
17+
.idea
18+
19+
# git stuff
20+
.git
21+
22+
ethcore/res/ethereum/tests

docker/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Usage
2+
3+
```docker build -f docker/ubuntu/Dockerfile --tag ethcore/parity:branch_or_tag_name .```

docker/centos/Dockerfile

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
FROM centos:latest
22
WORKDIR /build
3+
34
# install tools and dependencies
45
RUN yum -y update&& \
56
yum install -y git make gcc-c++ gcc file binutils
7+
68
# install rustup
79
RUN curl -sSf https://static.rust-lang.org/rustup.sh -o rustup.sh &&\
810
ls&&\
911
sh rustup.sh --disable-sudo
12+
1013
# show backtraces
1114
ENV RUST_BACKTRACE 1
15+
1216
# set compiler
1317
ENV CXX g++
1418
ENV CC gcc
19+
1520
# show tools
1621
RUN rustc -vV && \
1722
cargo -V && \
1823
gcc -v &&\
1924
g++ -v
25+
2026
# build parity
21-
RUN git clone https://github.com/paritytech/parity && \
22-
cd parity&&\
23-
git checkout beta && \
24-
git pull && \
25-
ls -a&&\
26-
cargo build --release --verbose && \
27+
ADD . /build/parity
28+
RUN cd parity&&\
29+
cargo build --release --verbose && \
2730
ls /build/parity/target/release/parity && \
2831
strip /build/parity/target/release/parity
2932

docker/hub/Dockerfile

-83
This file was deleted.

docker/hub/README.md

-3
This file was deleted.

docker/ubuntu-aarch64/Dockerfile

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM ubuntu:14.04
22
WORKDIR /build
3+
34
# install tools and dependencies
45
RUN apt-get -y update && \
56
apt-get install -y --force-yes --no-install-recommends \
@@ -24,14 +25,11 @@ RUN rustup target add aarch64-unknown-linux-gnu
2425
ENV RUST_BACKTRACE 1
2526

2627
# show tools
27-
RUN rustc -vV && \
28-
cargo -V
28+
RUN rustc -vV && cargo -V
2929

3030
# build parity
31-
RUN git clone https://github.com/paritytech/parity && \
32-
cd parity && \
33-
git checkout beta && \
34-
git pull && \
31+
ADD . /build/parity
32+
RUN cd parity && \
3533
mkdir -p .cargo && \
3634
echo '[target.aarch64-unknown-linux-gnu]\n\
3735
linker = "aarch64-linux-gnu-gcc"\n'\

docker/ubuntu-arm/Dockerfile

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM ubuntu:14.04
22
WORKDIR /build
3+
34
# install tools and dependencies
45
RUN apt-get -y update && \
56
apt-get install -y --force-yes --no-install-recommends \
@@ -23,16 +24,12 @@ RUN rustup target add armv7-unknown-linux-gnueabihf
2324
# show backtraces
2425
ENV RUST_BACKTRACE 1
2526

26-
2727
# show tools
28-
RUN rustc -vV && \
29-
cargo -V
28+
RUN rustc -vV && cargo -V
3029

3130
# build parity
32-
RUN git clone https://github.com/paritytech/parity && \
33-
cd parity && \
34-
git checkout beta && \
35-
git pull && \
31+
ADD . /build/parity
32+
RUN cd parity && \
3633
mkdir -p .cargo && \
3734
echo '[target.armv7-unknown-linux-gnueabihf]\n\
3835
linker = "arm-linux-gnueabihf-gcc"\n'\

docker/ubuntu-dev/Dockerfile

-37
This file was deleted.

docker/ubuntu-jit/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM ubuntu:14.04
22
WORKDIR /build
3+
34
# install tools and dependencies
45
RUN apt-get update && \
56
apt-get install -y \
@@ -45,10 +46,8 @@ gcc -v &&\
4546
g++ -v
4647

4748
# build parity
48-
RUN git clone https://github.com/paritytech/parity && \
49-
cd parity && \
50-
git checkout beta && \
51-
git pull && \
49+
ADD . /build/parity
50+
RUN cd parity && \
5251
cargo build --release --features ethcore/jit --verbose && \
5352
ls /build/parity/target/release/parity && \
5453
strip /build/parity/target/release/parity

docker/ubuntu-stable/Dockerfile

-40
This file was deleted.

docker/ubuntu/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM ubuntu:14.04
22
WORKDIR /build
3+
34
# install tools and dependencies
45
RUN apt-get update && \
56
apt-get install -y \
@@ -29,10 +30,8 @@ gcc -v &&\
2930
g++ -v
3031

3132
# build parity
32-
RUN git clone https://github.com/paritytech/parity && \
33-
cd parity && \
34-
git checkout beta && \
35-
git pull && \
33+
ADD . /build/parity
34+
RUN cd parity && \
3635
cargo build --release --verbose && \
3736
ls /build/parity/target/release/parity && \
3837
strip /build/parity/target/release/parity

0 commit comments

Comments
 (0)