-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to follow our new Docker base image spec
- Loading branch information
Showing
10 changed files
with
114 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
on: pull_request | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Find Dockerfiles | ||
id: scan | ||
run: echo "dockerfiles=$(find . -name Dockerfile | cut -c3- | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT" | ||
outputs: | ||
dockerfiles: ${{ steps.scan.outputs.dockerfiles }} | ||
lint: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- "1.10" | ||
- "1.11" | ||
- "1.12" | ||
- "1.13" | ||
dockerfile: ${{ fromJSON(needs.setup.outputs.dockerfiles) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hadolint/hadolint-action@v1.6.0 | ||
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # [email protected].0 | ||
with: | ||
dockerfile: ${{ matrix.image }}/Dockerfile | ||
dockerfile: ${{ matrix.dockerfile }} | ||
ignore: DL3008 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# tags=articulate/elixir:1.13 | ||
# syntax=docker/dockerfile:1 | ||
FROM elixir:1.13-slim | ||
|
||
ENV SERVICE_ROOT /service | ||
ENV SERVICE_USER service | ||
ENV SERVICE_UID 1001 | ||
|
||
ARG TARGETARCH | ||
|
||
ADD --chmod=755 https://raw.githubusercontent.com/articulate/docker-bootstrap/main/scripts/install_packages /usr/local/bin/install_packages | ||
ADD --chmod=755 https://raw.githubusercontent.com/articulate/docker-bootstrap/main/scripts/awscli.sh /tmp/awscli.sh | ||
|
||
RUN install_packages make && /tmp/awscli.sh && rm /tmp/awscli.sh \ | ||
&& groupadd --gid $SERVICE_UID $SERVICE_USER \ | ||
&& useradd --create-home --shell /bin/bash --gid $SERVICE_UID --uid $SERVICE_UID $SERVICE_USER | ||
|
||
ADD --chmod=755 https://github.com/articulate/docker-bootstrap/releases/latest/download/docker-bootstrap_linux_${TARGETARCH} /entrypoint | ||
ADD --chmod=755 https://raw.githubusercontent.com/articulate/docker-bootstrap/main/scripts/docker-secrets /usr/local/bin/secrets | ||
ADD --chmod=755 https://raw.githubusercontent.com/vishnubob/wait-for-it/81b1373f17855a4dc21156cfe1694c31d7d1792e/wait-for-it.sh /wait-for-it.sh | ||
|
||
USER $SERVICE_USER | ||
WORKDIR $SERVICE_ROOT | ||
|
||
# Install Hex and Rebar | ||
RUN mix local.hex --force && mix local.rebar --force | ||
|
||
# Our entrypoint will pull in our environment variables from Consul and Vault, | ||
# and execute whatever command we provided the container. | ||
# See https://github.com/articulate/docker-bootstrap | ||
ENTRYPOINT [ "/entrypoint" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,40 @@ | ||
# Articulate Elixir Image | ||
# Docker Elixir Images | ||
|
||
Base Elixir image which contains common dependencies used in our organization. | ||
Base Elixir Docker images. | ||
|
||
Elixir version: | ||
## What's Included | ||
|
||
* `1.13` | ||
* `1.12` | ||
* `1.11` | ||
* `1.10` | ||
* [docker-bootstrap](https://github.com/articulate/docker-bootstrap) entrypoint | ||
for loading environment variables from Consul and Vault. | ||
* [secrets](https://github.com/articulate/docker-bootstrap/blob/main/scripts/docker-secrets) | ||
to load Docker secrets as environment variables. | ||
* [install_packages](https://github.com/articulate/docker-bootstrap/blob/main/scripts/install_packages) | ||
to install apt packages. | ||
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) | ||
for interacting with AWS services. | ||
|
||
## Local Development | ||
## Tags | ||
|
||
Run `make` to build the image locally | ||
> 🌟 recommended image | ||
* __articulate/elixir:1.13__ 🌟 | ||
* articulate/articulate-elixir:1.13 | ||
* articulate/articulate-elixir:1.12 | ||
* articulate/articulate-elixir:1.11 | ||
|
||
### articulate/elixir vs articulate/articulate-elixir | ||
|
||
`articulate/articulate-elixir` are the legacy Docker images. These run as root and | ||
include additional software not always needed. Use `articulate/elixir` where possible | ||
and install your own software with `install_packages`. | ||
|
||
## Creating a new image | ||
|
||
The easiest way to create a new image is to copy an existing one and change the | ||
base image. If creating from scratch, the images need the following: | ||
|
||
* Everything listed in [What's included](#whats-included) | ||
* `make` for internal tooling. | ||
* A _service_ user and group with a GID and UID of 1001. This should be the default | ||
user. | ||
* A _/service_ directory as the default working directory. |