Skip to content

Commit 5ddc108

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 c0d434d commit 5ddc108

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/build/builder.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ export default class Builder {
9696
inputStream.on('error', failBuild);
9797
dup.on('error', failBuild);
9898

99+
// If buildOpts includes any volumes, JSON serialize them before passing
100+
// them to the engine
101+
if (buildOpts.volumes != null && Array.isArray(buildOpts.volumes)) {
102+
buildOpts.volumes = JSON.stringify(buildOpts.volumes);
103+
}
104+
99105
const buildPromise = (async () => {
100106
const daemonStream = await this.docker.buildImage(inputStream, buildOpts);
101107

0 commit comments

Comments
 (0)