Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions opm-example.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM quay.io/operator-framework/upstream-opm-builder AS builder
# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM quay.io/operator-framework/opm:latest

FROM scratch
LABEL operators.operatorframework.io.index.database.v1=./index.db
COPY ["nsswitch.conf", "/etc/nsswitch.conf"]
COPY database ./
COPY --from=builder /bin/opm /opm
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/opm"]
CMD ["registry", "serve", "--database", "index.db"]
# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]

# Copy declarative config root into image at /configs
ADD index /configs

# Set DC-specific label for the location of the DC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
2 changes: 1 addition & 1 deletion pkg/containertools/dockerfilegenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
DefaultBinarySourceImage = "quay.io/operator-framework/upstream-opm-builder"
DefaultBinarySourceImage = "quay.io/operator-framework/opm:latest"
DefaultDbLocation = "/database/index.db"
DbLocationLabel = "operators.operatorframework.io.index.database.v1"
ConfigsLocationLabel = "operators.operatorframework.io.index.configs.v1"
Expand Down
6 changes: 3 additions & 3 deletions pkg/containertools/dockerfilegenerator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package containertools_test
import (
"testing"

"github.com/operator-framework/operator-registry/pkg/containertools"

"github.com/golang/mock/gomock"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/pkg/containertools"
)

func TestGenerateDockerfile(t *testing.T) {
Expand Down Expand Up @@ -39,7 +39,7 @@ func TestGenerateDockerfile_EmptyBaseImage(t *testing.T) {
defer controller.Finish()

databasePath := "database/index.db"
expectedDockerfile := `FROM quay.io/operator-framework/upstream-opm-builder
expectedDockerfile := `FROM quay.io/operator-framework/opm:latest
LABEL operators.operatorframework.io.index.database.v1=/database/index.db
ADD database/index.db /database/index.db
EXPOSE 50051
Expand Down