Skip to content

Commit

Permalink
nix: fix deprecation warning for docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgi committed Mar 17, 2023
1 parent 0496c35 commit f2109b8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 28 deletions.
32 changes: 17 additions & 15 deletions nix/docker/default.nix
Expand Up @@ -61,19 +61,23 @@ let
# Layer of tools which aren't going to change much between versions.
baseImage = dockerTools.buildImage {
name = "${repoName}-env";
contents = [
cardano-cli # Provide cardano-cli capability
bashInteractive # Provide the BASH shell
cacert # X.509 certificates of public CA's
coreutils # Basic utilities expected in GNU OS's
curl # CLI tool for transferring files via URLs
glibcLocales # Locale information for the GNU C Library
iana-etc # IANA protocol and port number assignments
iproute # Utilities for controlling TCP/IP networking
iputils # Useful utilities for Linux networking
socat # Utility for bidirectional data transfer
utillinux # System utilities for Linux
];
copyToRoot = pkgs.buildEnv {
name = "image-root";
pathsToLink = ["/"];
paths = [
cardano-cli # Provide cardano-cli capability
bashInteractive # Provide the BASH shell
cacert # X.509 certificates of public CA's
coreutils # Basic utilities expected in GNU OS's
curl # CLI tool for transferring files via URLs
glibcLocales # Locale information for the GNU C Library
iana-etc # IANA protocol and port number assignments
iproute # Utilities for controlling TCP/IP networking
iputils # Useful utilities for Linux networking
socat # Utility for bidirectional data transfer
utillinux # System utilities for Linux
];
};
# set up /tmp (override with TMPDIR variable)
extraCommands = ''
mkdir -m 0777 tmp
Expand Down Expand Up @@ -113,8 +117,6 @@ in
tag = "${gitrev}";
fromImage = baseImage;
created = "now"; # Set creation date to build time. Breaks reproducibility
contents = [
];

# May require system-features = kvm in /etc/nix/nix.conf
# https://discourse.nixos.org/t/cannot-build-docker-image/7445
Expand Down
34 changes: 21 additions & 13 deletions nix/docker/submit-api.nix
Expand Up @@ -58,18 +58,22 @@ let
# Layer of tools which aren't going to change much between versions.
baseImage = dockerTools.buildImage {
name = "${repoName}-env";
contents = [
bashInteractive # Provide the BASH shell
cacert # X.509 certificates of public CA's
coreutils # Basic utilities expected in GNU OS's
curl # CLI tool for transferring files via URLs
glibcLocales # Locale information for the GNU C Library
iana-etc # IANA protocol and port number assignments
iproute # Utilities for controlling TCP/IP networking
iputils # Useful utilities for Linux networking
socat # Utility for bidirectional data transfer
utillinux # System utilities for Linux
];
copyToRoot = pkgs.buildEnv {
name = "image-root";
pathsToLink = ["/"];
paths = [
bashInteractive # Provide the BASH shell
cacert # X.509 certificates of public CA's
coreutils # Basic utilities expected in GNU OS's
curl # CLI tool for transferring files via URLs
glibcLocales # Locale information for the GNU C Library
iana-etc # IANA protocol and port number assignments
iproute # Utilities for controlling TCP/IP networking
iputils # Useful utilities for Linux networking
socat # Utility for bidirectional data transfer
utillinux # System utilities for Linux
];
};
# set up /tmp (override with TMPDIR variable)
extraCommands = ''
mkdir -m 0777 tmp
Expand Down Expand Up @@ -98,7 +102,11 @@ let
fromImage = baseImage;
tag = "${gitrev}";
created = "now"; # Set creation date to build time. Breaks reproducibility
contents = [ entry-point ];
copyToRoot = pkgs.buildEnv {
name = "image-root";
pathsToLink = ["/"];
paths = [entry-point];
};
config = {
EntryPoint = [ "${entry-point}/bin/entry-point" ];
ExposedPorts = {
Expand Down

0 comments on commit f2109b8

Please sign in to comment.