-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
55 lines (50 loc) · 2.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
IMAGE_NAME=sineverba/php74xc
CONTAINER_NAME=php74xc
APP_VERSION=1.11.0-dev
COMPOSER_VERSION=1.10.27
XDEBUG_VERSION=3.1.6
MCRYPT_VERSION=1.0.7
BUILDX_VERSION=0.13.1
BINFMT_VERSION=qemu-v7.0.0-28
build:
docker build \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
--build-arg MCRYPT_VERSION=$(MCRYPT_VERSION) \
--tag $(IMAGE_NAME):$(APP_VERSION) \
"."
preparemulti:
mkdir -vp ~/.docker/cli-plugins
curl \
-L \
"https://github.com/docker/buildx/releases/download/v$(BUILDX_VERSION)/buildx-v$(BUILDX_VERSION).linux-amd64" \
> \
~/.docker/cli-plugins/docker-buildx
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker buildx version
docker run --rm --privileged tonistiigi/binfmt:$(BINFMT_VERSION) --install all
docker buildx ls
docker buildx rm multiarch
docker buildx create --name multiarch --driver docker-container --use
multi:
docker buildx inspect --bootstrap --builder multiarch
docker buildx build \
--platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
--build-arg MCRYPT_VERSION=$(MCRYPT_VERSION) \
--tag $(IMAGE_NAME):$(APP_VERSION) "."
test:
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -v | grep 7.4.33
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -v | grep OPcache
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -m | grep xdebug
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -r "xdebug_info();" | grep $(XDEBUG_VERSION)
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -m | grep pdo_pgsql
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -m | grep zip
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -m | grep mcrypt
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) /usr/bin/composer -V | grep "1.10.27"
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -i | grep "short_open_tag => Off => Off"
@docker run --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(APP_VERSION) php -i | grep "memory_limit => 512M => 512M"
destroy:
docker image rm php:7.4.33-cli
docker image rm $(IMAGE_NAME):$(APP_VERSION)