Skip to content

Commit

Permalink
fix: pull image await via stream
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Nov 19, 2022
1 parent 8d5f0a2 commit a01a89c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ async function upgrade (name, version) {
console.info('Container has been removed.')

console.info('Pulling latest Wiki.js image...')
await dk.pull(`ghcr.io/requarks/wiki:${version}`)
await new Promise((resolve, reject) => {
dk.pull(`ghcr.io/requarks/wiki:${version}`, (err, stream) => {
if (err) { return reject(err) }
docker.modem.followProgress(stream, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
})

console.info('Recreating container...')
const wkn = await dk.createContainer({
Expand Down

0 comments on commit a01a89c

Please sign in to comment.