Skip to content

Commit 3b0e833

Browse files
committed
Updated docker file
1 parent 337e585 commit 3b0e833

File tree

12 files changed

+47
-24
lines changed

12 files changed

+47
-24
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Paths to packages
22
GO=$(shell which go)
3+
DOCKER=$(shell which docker)
34

45
# Paths to locations, etc
56
BUILD_DIR := "build"
67
CMD_DIR := $(filter-out cmd/README.md, $(wildcard cmd/*))
78

89
# Build flags
9-
BUILD_MODULE = "github.com/mutablelogic/go-media"
10+
BUILD_MODULE := $(shell go list -m)
1011
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitSource=${BUILD_MODULE}
1112
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitTag=$(shell git describe --tags)
1213
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitBranch=$(shell git name-rev HEAD --name-only --always)
@@ -28,6 +29,15 @@ $(PLUGIN_DIR): FORCE
2829

2930
FORCE:
3031

32+
docker:
33+
@echo Build docker image
34+
@${DOCKER} build \
35+
--tag go-media:$(shell git describe --tags) \
36+
--build-arg PLATFORM=$(shell ${GO} env GOOS) \
37+
--build-arg ARCH=$(shell ${GO} env GOARCH) \
38+
--build-arg VERSION=kinetic \
39+
-f etc/docker/Dockerfile .
40+
3141
test: clean dependencies
3242
@echo Test sys/
3343
@${GO} test ./sys/...

etc/docker/Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
# recommended way to build is using:
22
# docker build \
3-
# --build-arg PLATFORM=linux --build-arg ARCH=amd64 --build-arg VERSION=bullseye \
3+
# --build-arg PLATFORM=linux --build-arg ARCH=amd64 --build-arg VERSION=focal \
44
# -f etc/docker/Dockerfile .
55
#
6+
# ${VERSION} should be "focal"
67
ARG PLATFORM
78
ARG ARCH
89
ARG VERSION
9-
FROM --platform=${PLATFORM}/${ARCH} golang:1.19-${VERSION} AS builder
10+
FROM --platform=${PLATFORM}/${ARCH} ubuntu:${VERSION} AS builder
11+
12+
# update the base packages
13+
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Berlin"
14+
RUN apt-get update -y && apt-get upgrade -y
15+
16+
# install packages
17+
RUN apt-get install -y apt-utils golang make pkg-config ca-certificates lsb-release software-properties-common
18+
19+
# install other build dependencies
20+
# note we need to install ffmpeg 4 from a different repo for bionic
21+
RUN apt-get install -y \
22+
libavcodec-dev libavdevice-dev libavfilter-dev \
23+
libavformat-dev libswresample-dev libavutil-dev libchromaprint-dev
1024

1125
# Run makefile to build command-line tools
1226
WORKDIR /usr/src/app

sys/dvb/demux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb
44

sys/dvb/demux_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb_test
44

55
import (
6+
"github.com/mutablelogic/go-media/sys/dvb"
67
"testing"
7-
8-
"github.com/djthorpe/gopi/v3/pkg/sys/dvb"
98
)
109

1110
func Test_Demux_000(t *testing.T) {

sys/dvb/device.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb
44

@@ -10,8 +10,6 @@ import (
1010
"strings"
1111
"syscall"
1212
"unsafe"
13-
14-
"github.com/djthorpe/gopi/v3"
1513
)
1614

1715
////////////////////////////////////////////////////////////////////////////////

sys/dvb/device_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb_test
44

55
import (
6+
"github.com/mutablelogic/go-media/sys/dvb"
67
"os"
78
"testing"
8-
9-
"github.com/djthorpe/gopi/v3/pkg/sys/dvb"
109
)
1110

1211
func Test_Device_000(t *testing.T) {

sys/dvb/frontend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb
44

sys/dvb/frontend_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb_test
44

55
import (
6+
"github.com/mutablelogic/go-media/sys/dvb"
67
"os"
78
"testing"
89
"time"
9-
10-
"github.com/djthorpe/gopi/v3/pkg/sys/dvb"
1110
)
1211

1312
func Test_Frontend_000(t *testing.T) {

sys/dvb/tunetable.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build dvb
2+
13
package dvb
24

35
import (

sys/dvb/tunetable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build dvb
1+
//go:build dvb
22

33
package dvb_test
44

0 commit comments

Comments
 (0)