unfor19 / alpine-ci

Docker image of Linux alpine, mostly suited for simple CI tasks

Home Page:https://meirg.co.il

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alpine-ci

Push latest release to DockerHub DockerHub Pulls

Docker image of Linux alpine which includes the following packages

alpine            3.14
awscli            2.2.0
bash              5.1
curl              7.79
docker            20.10
git               2.32
jq                1.6
openssh           8.6
zip               3.0
awscli            2.4.13
openssl           1.1.1
docker_file_path  /opt/alpineci_version

Included in alpine

  • tar
  • unzip
  • wget
  • Listing all built-in packages
    docker run --entrypoint busybox --rm alpine:3.12 --list

Usage

  • Run the latest release

    docker run --rm -it unfor19/alpine-ci
  • Run a specific release

    RELEASE_TAG="master-f92a0197"
    docker run "unfor19/alpine-ci:${RELEASE_TAG}"
  • Use as a base image in a Dockerfile

ARG ALPINECI_TAG
FROM unfor19/alpine-ci:${ALPINECI_TAG} as base

# Do your "build" stuff ...
WORKDIR /code/
RUN curl -s https://catfact.ninja/fact | jq -r .fact > fact.txt

# Use Docker multi-stage
FROM ubuntu:20.04 as app
WORKDIR /app/
COPY --from=base /code/* /app/
CMD find -type f -name *.txt -exec cat {} \;
  • Build your image

    ALPINECI_TAG="latest"
    DOCKERFILE_PATH="Dockerfile.example"
    IMAGE_NAME="catfact"
    docker build --build-arg ALPINECI_TAG="$ALPINECI_TAG" -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
  • Run a container of your image

    IMAGE_NAME="catfact"
    docker run --rm "$IMAGE_NAME"
    
    # Random output:
    # Many cats cannot properly digest cow's milk. Milk and milk products give them diarrhea.

Tips

When to use ubuntu instead of alpine?

Choosing alpine is awesome, but in some scenarios it just won't cut it. Here are some popular use-cases that might help you with choosing the right linux distribution.

  • Building a Python app - some Python packages require glibc and trying to compile them with alpine's musl won't do it. For simple Python apps it's ok, but if it breaks after you add some package, then switching to ubuntu might be better for you
  • AWS CLI v1 - requires Python
  • AWS CLI v2 - requires glibc

Authors

Created and maintained by Meir Gabay

About

Docker image of Linux alpine, mostly suited for simple CI tasks

https://meirg.co.il


Languages

Language:Dockerfile 68.6%Language:Shell 31.4%