Skip to content

Commit 96f6c3b

Browse files
committed
Use JSON serialization for balena build secrets
Build secrets make use of a `volumes` option passed to the build image docker API. This option is only available in balenaEngine. With the changes on apocas/docker-modem#181, this array will be serialized using URL serialization by dockerode, which is not accepted by balenaEngine. Change-type: patch
1 parent 69284c5 commit 96f6c3b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/multibuild/build-secrets/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export async function populateSecrets(
146146
const imageName = 'balena-secrets:latest';
147147
const dockerOpts = {
148148
t: imageName,
149-
volumes: [`${tmpDir}:${tmpDir}:rw`],
149+
volumes: JSON.stringify([`${tmpDir}:${tmpDir}:rw`]),
150150
forcerm: true,
151151
};
152152
const builder = Builder.fromDockerode(docker);
@@ -206,7 +206,7 @@ export async function removeSecrets(
206206
const imageName = 'balena-secrets-remove:latest';
207207
const dockerOpts = {
208208
t: imageName,
209-
volumes: [`${tmpDir}:${tmpDir}:rw`],
209+
volumes: JSON.stringify([`${tmpDir}:${tmpDir}:rw`]),
210210
forcerm: true,
211211
};
212212
const builder = Builder.fromDockerode(docker);

0 commit comments

Comments
 (0)