Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf386c5e

Browse files
committed
build(docker): cleanup docker images
Moved all run commands into a single block to reduce the number of layers in the image. Remove testfiles. Cleanup Makefile and README
1 parent63b527e commitf386c5e

File tree

6 files changed

+35
-46
lines changed

6 files changed

+35
-46
lines changed

‎1.10/Dockerfile‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ FROM elixir:1.10-slim
33
ENV SERVICE_ROOT /service
44
ENV SERVICE_USER service
55

6-
# install hex package manager
7-
RUN mix local.hex --force
8-
RUN mix local.rebar --force
9-
106
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/install.sh /tmp/consul_template_install.sh
11-
RUN bash /tmp/consul_template_install.sh&& rm /tmp/consul_template_install.sh
7+
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/wait-for-it.sh/wait-for-it.sh
128

13-
RUN groupadd $SERVICE_USER && useradd --create-home --home $SERVICE_ROOT --gid $SERVICE_USER --shell /bin/bash $SERVICE_USER
14-
WORKDIR $SERVICE_ROOT
9+
# install hex package manager
10+
RUN mix local.hex --force && \
11+
mix local.rebar --force && \
12+
bash /tmp/consul_template_install.sh && rm /tmp/consul_template_install.sh && \
13+
groupadd $SERVICE_USER && useradd --create-home --home $SERVICE_ROOT --gid $SERVICE_USER --shell /bin/bash $SERVICE_USER && \
14+
chmod a+rx /wait-for-it.sh
1515

16-
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/wait-for-it.sh /wait-for-it.sh
17-
RUN chmod a+rx /wait-for-it.sh
16+
WORKDIR $SERVICE_ROOT
1817

1918
ENTRYPOINT ["/entrypoint.sh"]

‎1.10/docker-compose.test.yml‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎1.9/Dockerfile‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ FROM elixir:1.9-slim
33
ENV SERVICE_ROOT /service
44
ENV SERVICE_USER service
55

6-
# install hex package manager
7-
RUN mix local.hex --force
8-
RUN mix local.rebar --force
9-
106
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/install.sh /tmp/consul_template_install.sh
11-
RUN bash /tmp/consul_template_install.sh&& rm /tmp/consul_template_install.sh
7+
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/wait-for-it.sh/wait-for-it.sh
128

13-
RUN groupadd $SERVICE_USER && useradd --create-home --home $SERVICE_ROOT --gid $SERVICE_USER --shell /bin/bash $SERVICE_USER
14-
WORKDIR $SERVICE_ROOT
9+
# install hex package manager
10+
RUN mix local.hex --force && \
11+
mix local.rebar --force && \
12+
bash /tmp/consul_template_install.sh && rm /tmp/consul_template_install.sh && \
13+
groupadd $SERVICE_USER && useradd --create-home --home $SERVICE_ROOT --gid $SERVICE_USER --shell /bin/bash $SERVICE_USER && \
14+
chmod a+rx /wait-for-it.sh
1515

16-
ADD https://raw.githubusercontent.com/articulate/docker-consul-template-bootstrap/master/wait-for-it.sh /wait-for-it.sh
17-
RUN chmod a+rx /wait-for-it.sh
16+
WORKDIR $SERVICE_ROOT
1817

1918
ENTRYPOINT ["/entrypoint.sh"]

‎1.9/docker-compose.test.yml‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Makefile‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
default: build_1.10
1+
help:
2+
@echo"+$@"
3+
@grep -hE'(^[a-zA-Z0-9\._-]+:.*?##.*$$)|(^##)'$(MAKEFILE_LIST)| awk'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'| sed -e's/\[32m## /[33m/'
4+
.PHONY: help
25

3-
build_1.10:
4-
docker build -t local/articulate-elixir:1.10 ./1.10
6+
1.10:## Build the Elixir 1.10 image
7+
@echo"+ Elixir$@"
8+
@docker build -t articulate/articulate-elixir:1.10 1.10
9+
.PHONY: 1.10
510

6-
build_1.9:
7-
docker build -t local/articulate-elixir:1.9 ./1.9
11+
1.9:## Build the Elixir 1.9 image
12+
@echo"+ Elixir$@"
13+
@docker build -t articulate/articulate-elixir:1.9 1.9
14+
.PHONY: 1.9
15+
16+
all: 1.10 1.9## Build all Elixir images
17+
.PHONY: all

‎README.md‎

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,11 @@
22

33
Base Elixir image which contains common dependencies used in our organization.
44

5-
This image is auto-built on pushes/merges to master via the[articulate/articulate-elixir](https://cloud.docker.com/u/articulate/repository/docker/articulate/articulate-elixir) Dockerhub repo.
5+
Elixir version:
66

7-
Currently built tags include:
8-
-`1.10`
9-
-`1.9`
10-
-`1.8`
11-
12-
##Pull Request Tests
13-
14-
PR testing is done through the`Autotest` being run in the dockerhub repo itself. Each docker image gets tested against a`docker-compose.test.yml` file that requires a`sut` service in it,[as per dockerhub documentation](https://docs.docker.com/docker-hub/builds/automated-testing/).
15-
16-
The configuration for the autotesting can be found in the[Configure Automated Builds section](https://cloud.docker.com/u/articulate/repository/docker/articulate/articulate-elixir/builds/edit).
7+
*`1.10`
8+
*`1.9`
179

1810
##Local Development
1911

20-
1. Run`make` to build a`local/articulate-elixir` image locally (this will have the latest version of elixir on it - use the`make build_1_8` to build the`local/articulate-elixir:1.8` image.
21-
22-
2. Change the first line of your`Dockerfile` to be`FROM local/articulate-elixir`.
23-
24-
25-
3. Then`docker-compose build --no-cache && docker-compose up`.
12+
Run`make [version]` to build the image locally

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp