We're deprecating providertest.NewProviderTest, so use the new pulumitest based approach instead. - Update test code to use PreviewProviderUpgrade. - Use provider attachment instead of the bin directory. - Rename state.json to stack.json & let the first run migrate the stack to a stable, non-machine dependent name.
184 lines
4.9 KiB
YAML
184 lines
4.9 KiB
YAML
name: provider-docker-build
|
|
runtime: yaml
|
|
|
|
resources:
|
|
# docker buildx build -f app/Dockerfile.multiPlatform --platform plan9/amd64,plan9/386 app
|
|
multiPlatform:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.multiPlatform"
|
|
context:
|
|
location: "./app"
|
|
platforms:
|
|
- plan9/amd64
|
|
- plan9/386
|
|
|
|
# docker buildx build --output=type=registry app
|
|
registryPush:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
context:
|
|
location: "./app"
|
|
tags: ["docker.io/pulumibot/buildkit-e2e:example"]
|
|
exports:
|
|
- registry:
|
|
ociMediaTypes: true
|
|
push: false # Omit this to actually push images.
|
|
|
|
# docker buildx build --cache-to=type=local,dest=tmp/cache,mode=max --cache-from=type=local,src=tmp/cache app
|
|
cached:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
context:
|
|
location: "./app"
|
|
cacheTo:
|
|
- local:
|
|
dest: tmp/cache
|
|
mode: max
|
|
cacheFrom:
|
|
- local:
|
|
src: tmp/cache
|
|
|
|
# docker buildx build -f app/Dockerfile.buildArgs --build-arg SET_ME_TO_TRUE=true app
|
|
buildArgs:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.buildArgs"
|
|
context:
|
|
location: "./app"
|
|
buildArgs:
|
|
SET_ME_TO_TRUE: "true"
|
|
|
|
# docker buildx build -f app/Dockerfile.extraHosts --add-host metadata.google.internal:169.254.169.254 app
|
|
extraHosts:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.extraHosts"
|
|
context:
|
|
location: "./app"
|
|
addHosts:
|
|
- "metadata.google.internal:169.254.169.254"
|
|
|
|
# docker buildx build -f app/Dockerfile.sshMount --ssh default app
|
|
sshMount:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.sshMount"
|
|
context:
|
|
location: "./app"
|
|
ssh:
|
|
- id: default
|
|
|
|
# PASSWORD=hunter2 docker buildx build -f app/Dockerfile.secrets --secret id=password,env=PASSWORD app
|
|
secrets:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.secrets"
|
|
context:
|
|
location: "./app"
|
|
secrets:
|
|
password: hunter2
|
|
|
|
# docker buildx build --label "description=This image will get a descriptive label 👍" app
|
|
labels:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
context:
|
|
location: "./app"
|
|
labels:
|
|
description: "This image will get a descriptive label 👍"
|
|
|
|
# docker buildx build -f app/Dockerfile.target --target build-me app
|
|
target:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.target"
|
|
context:
|
|
location: "./app"
|
|
target: "build-me"
|
|
|
|
# docker buildx build -f app/Dockerfile.namedContexts \
|
|
# --build-context golang:latest=docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984 app
|
|
namedContexts:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
location: "./app/Dockerfile.namedContexts"
|
|
context:
|
|
location: "./app"
|
|
named:
|
|
"golang:latest":
|
|
location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"
|
|
|
|
# docker buildx build https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile
|
|
remoteContext:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
context:
|
|
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
|
|
|
# docker buildx build -f - https://github.com/docker-library/hello-world.git <<EOF
|
|
# FROM busybox
|
|
# COPY hello.c ./
|
|
# EOF
|
|
remoteContextWithInline:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
inline: |
|
|
FROM busybox
|
|
COPY hello.c ./
|
|
context:
|
|
location: "https://github.com/docker-library/hello-world.git"
|
|
|
|
# echo "FROM alpine" | docker buildx build -f - .
|
|
inline:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
dockerfile:
|
|
inline: |
|
|
FROM alpine
|
|
RUN echo "This uses an inline Dockerfile! 👍"
|
|
context:
|
|
location: "./app"
|
|
|
|
# docker buildx build --load .
|
|
dockerLoad:
|
|
type: docker-build:Image
|
|
properties:
|
|
push: false
|
|
context:
|
|
location: "./app"
|
|
exports:
|
|
- docker:
|
|
tar: true
|
|
|
|
# docker buildx build - < app/Dockerfile.emptyContext
|
|
#emptyContext:
|
|
# type: docker-build:Image
|
|
# properties:
|
|
# file: "app/Dockerfile.emptyContext"
|
|
# context: "-"
|
|
|
|
outputs:
|
|
platforms: ${multiPlatform.platforms}
|