Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Use nix based docker base image #730

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ target/release/build
target/release/deps
target/release/examples
target/release/incremental
target/doc
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ jobs:
name: wallet-webserver
path: wallet-checkout/target/release/

- name: Set linker/loader to not be nix
run: patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 wallet-checkout/target/release/web_server

- uses: docker/setup-buildx-action@v1
name: Setup Docker BuildKit (buildx)
with:
driver: docker

- uses: docker/login-action@v1
name: Login to Github Container Repo
Expand All @@ -118,6 +117,9 @@ jobs:
with:
images: ghcr.io/espressosystems/cape/wallet

- name: Generate base image
run: cd wallet-checkout && bin/build-docker-base

- uses: docker/build-push-action@v2
name: Build and Push Docker
with:
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM ubuntu:impish
RUN apt-get update \
&& apt-get install -y libcurl4 \
&& rm -rf /var/lib/apt/lists/*
FROM nix-base-docker
COPY target/release/web_server /app/web_server
COPY wallet/api /app/api
COPY wallet/public /app/public
Expand Down
3 changes: 3 additions & 0 deletions bin/build-docker-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix --experimental-features "nix-command flakes" build .#docker
docker load --input result
10 changes: 10 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@
};
};
};
# A nix base image
packages.docker = pkgs.dockerTools.buildImage {
name = "nix-base-docker";
tag = "latest";
contents = with pkgs; [
curl
coreutils
bashInteractive
];
};
devShell =
let
mySolc = pkgs.callPackage ./nix/solc-bin { version = "0.8.10"; };
Expand Down