Skip to content

Commit

Permalink
#39 Align use of docker (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj authored Jan 5, 2024
1 parent e0583dc commit 586f0cc
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 213 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/docker-build-container.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/make-github-release-assets-darwin.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/make-github-release-assets-linux.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions Dockerfile

This file was deleted.

39 changes: 20 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ dependencies:

# -----------------------------------------------------------------------------
# Build
# - docker-build: https://docs.docker.com/engine/reference/commandline/build/
# -----------------------------------------------------------------------------

PLATFORMS := darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 windows/amd64 windows/arm64
Expand All @@ -82,14 +81,6 @@ $(PLATFORMS):
.PHONY: build
build: build-osarch-specific


.PHONY: docker-build
docker-build:
@docker build \
--tag $(DOCKER_IMAGE_NAME) \
--tag $(DOCKER_IMAGE_NAME):$(BUILD_VERSION) \
.

# -----------------------------------------------------------------------------
# Test
# -----------------------------------------------------------------------------
Expand All @@ -101,19 +92,29 @@ test: test-osarch-specific
# Run
# -----------------------------------------------------------------------------

.PHONY: docker-run
docker-run:
@docker run \
--interactive \
--rm \
--tty \
--name $(DOCKER_CONTAINER_NAME) \
$(DOCKER_IMAGE_NAME)


.PHONY: run
run: run-osarch-specific

# -----------------------------------------------------------------------------
# Package
# -----------------------------------------------------------------------------

.PHONY: docker-build-package
docker-build-package:
@docker build \
--build-arg BUILD_ITERATION=$(BUILD_ITERATION) \
--build-arg BUILD_VERSION=$(BUILD_VERSION) \
--build-arg GO_PACKAGE_NAME=$(GO_PACKAGE_NAME) \
--build-arg PROGRAM_NAME=$(PROGRAM_NAME) \
--no-cache \
--file package.Dockerfile \
--tag $(DOCKER_BUILD_IMAGE_NAME) \
.


.PHONY: package
package: package-osarch-specific

# -----------------------------------------------------------------------------
# Utility targets
# -----------------------------------------------------------------------------
Expand Down
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,6 @@ senzing-tools explain [flags]

1. See [Parameters](#parameters) for additional parameters.

### Using Docker

This usage shows how to initialze a database with a Docker container.

1. :pencil2: Run `senzing/senzing-tools`.
Example:

```console
docker run \
--env SENZING_TOOLS_COMMAND=explain \
--env SENZING_TOOLS_ERROR_ID=senzing-60010032 \
--rm \
senzing/senzing-tools
```

1. See [Parameters](#parameters) for additional parameters.

### Parameters

- **[LD_LIBRARY_PATH](https://github.com/senzing-garage/knowledge-base/blob/main/lists/environment-variables.md#ld_library_path)**
Expand Down
21 changes: 0 additions & 21 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,6 @@ Since the Senzing library is a prerequisite, it must be installed first.
the reference can be found by clicking on the following badge at the top of the README.md page:
[![Go Reference](https://pkg.go.dev/badge/github.com/senzing-garage/explain.svg)](https://pkg.go.dev/github.com/senzing-garage/explain)

## Docker

1. Use make target to run a docker images that builds RPM and DEB files.
Example:

```console
cd ${GIT_REPOSITORY_DIR}
make docker-build

```

1. Run docker container.
Example:

```console
docker run \
--rm \
senzing/explain

```

## Package

### Package RPM and DEB files
Expand Down
5 changes: 0 additions & 5 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@

The following examples require initialization described in
[Demonstrate using Command Line Interface](../README.md#demonstrate-using-command-line-interface).

## Examples of Docker

The following examples require initialization described in
[Demonstrate using Docker](../README.md#demonstrate-using-docker).
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM=
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
7 changes: 5 additions & 2 deletions makefiles/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ build-osarch-specific: darwin/amd64

.PHONY: clean-osarch-specific
clean-osarch-specific:
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -rf $(TARGET_DIRECTORY) || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true

Expand All @@ -26,6 +24,11 @@ hello-world-osarch-specific:
@echo "Hello World, from darwin."


.PHONY: package-osarch-specific
package-osarch-specific:
@echo No packaging for darwin.


.PHONY: run-osarch-specific
run-osarch-specific:
@go run -exec macos_exec_dyld.sh main.go
Expand Down
10 changes: 8 additions & 2 deletions makefiles/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ build-osarch-specific: linux/amd64

.PHONY: clean-osarch-specific
clean-osarch-specific:
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -rf $(TARGET_DIRECTORY) || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true

Expand All @@ -26,6 +24,14 @@ hello-world-osarch-specific:
@echo "Hello World, from linux."


.PHONY: package-osarch-specific
package-osarch-specific: docker-build-package
@mkdir -p $(TARGET_DIRECTORY) || true
@CONTAINER_ID=$$(docker create $(DOCKER_BUILD_IMAGE_NAME)); \
docker cp $$CONTAINER_ID:/output/. $(TARGET_DIRECTORY)/; \
docker rm -v $$CONTAINER_ID


.PHONY: run-osarch-specific
run-osarch-specific:
@go run main.go
Expand Down
5 changes: 5 additions & 0 deletions makefiles/windows.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ hello-world-osarch-specific:
@echo "Hello World, from windows."


.PHONY: package-osarch-specific
package-osarch-specific:
@echo No packaging for windows.


.PHONY: run-osarch-specific
run-osarch-specific:
@go run main.go
Expand Down
2 changes: 1 addition & 1 deletion package.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stages
# -----------------------------------------------------------------------------

ARG IMAGE_GO_BUILDER=golang:1.21.0-bullseye
ARG IMAGE_GO_BUILDER=golang:1.21.4-bullseye
ARG IMAGE_FPM_BUILDER=dockter/fpm:latest
ARG IMAGE_FINAL=alpine

Expand Down

0 comments on commit 586f0cc

Please sign in to comment.