From 418c3ddae8672a495be0095c4a90fb4e835160a2 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Wed, 27 Sep 2023 17:30:08 -0400 Subject: [PATCH] [Feat] Uses the bare base --- README.md | 2 +- {tests/config => config}/config.hcl | 0 rockcraft.yaml | 19 ++++++++++++++++++- tests/test_integration.py | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) rename {tests/config => config}/config.hcl (100%) diff --git a/README.md b/README.md index 8a02d39..72b336b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vault-rock -A ROCK image for Vault. +A distroless ROCK image for Vault. ## Usage diff --git a/tests/config/config.hcl b/config/config.hcl similarity index 100% rename from tests/config/config.hcl rename to config/config.hcl diff --git a/rockcraft.yaml b/rockcraft.yaml index 2e1f6e1..9e24f19 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -1,5 +1,5 @@ name: vault -base: ubuntu:22.04 +base: bare build-base: ubuntu:22.04 version: "1.14.3" summary: A ROCK container image for Vault @@ -9,6 +9,12 @@ license: Apache-2.0 platforms: amd64: +services: + vault: + command: vault server -config=/vault/config/config.hcl + override: replace + startup: enabled + parts: vault: @@ -20,3 +26,14 @@ parts: - bin/vault build-snaps: - go/1.20/stable + + default-config: + plugin: dump + source: ./config + organize: + config.hcl: /vault/config/config.hcl + + packages: + plugin: nil + stage-packages: + - ca-certificates diff --git a/tests/test_integration.py b/tests/test_integration.py index 46e3042..06915a4 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -35,7 +35,7 @@ class TestVaultRock(unittest.TestCase): def setUp(self): """Starts a Vault container.""" subprocess.check_call( - "docker run -d -p 8200:8200 -v ${PWD}/config:/vault/config --entrypoint /bin/bash vault-rock:test -c 'vault server -config=/vault/config/config.hcl'", # noqa: E501 + "docker run -d -p 8200:8200 vault-rock:test ", shell=True, )