Skip to content

Latest commit

 

History

History
99 lines (80 loc) · 1.54 KB

README.md

File metadata and controls

99 lines (80 loc) · 1.54 KB

@acao/docker

A self-sufficient runtime for containers

Usage

dockerBuild

// acao.config.ts
import { defineConfig, run } from 'acao'
import { dockerBuild } from 'acao/docker'

export default defineConfig({
  jobs: {
    ci: {
      steps: [
        dockerBuild({ tag: 'TAG', file: 'Dockerfile', stdio: 'inherit' }),
      ],
    },
  },
})

dockerLogin

// acao.config.ts
import { defineConfig, run } from 'acao'
import { dockerLogin } from 'acao/docker'

export default defineConfig({
  jobs: {
    ci: {
      steps: [
        dockerLogin('http://localhost', { username: 'root', password: '*' }),
      ],
    },
  },
})

dockerPush

// acao.config.ts
import { defineConfig, run } from 'acao'
import { dockerPush } from 'acao/docker'

export default defineConfig({
  jobs: {
    ci: {
      steps: [
        dockerPush('DOCKER_IMAGE'),
      ],
    },
  },
})

dockerRun

// acao.config.ts
import { defineConfig, run } from 'acao'
import { dockerRun } from 'acao/docker'

export default defineConfig({
  jobs: {
    ci: {
      steps: [
        dockerRun('node:18', 'npm install && npm run build', { volume: { dist: '~/dist' } }),
      ],
    },
  },
})

dockerRmi

// acao.config.ts
import { defineConfig, run } from 'acao'
import { dockerRmi } from 'acao/docker'

export default defineConfig({
  jobs: {
    ci: {
      steps: [
        dockerRmi(['node:18', 'node:20']),
      ],
    },
  },
})

License

MIT License © 2024-PRESENT Tamago