Skip to content

RFC: Support Alpine Linux #453

@YOU54F

Description

@YOU54F

Rationale

We have warnings in the code, if on Alpine - See #246

but we now have native musl based shared libraries for the pact_ffi

https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.23

It would be nice to add proper support for these variants in pact-go

Approach

  1. When detecting musl, instead of warning user, provide download for *.so musl variant in https://github.com/pact-foundation/pact-go/blob/master/installer/installer.go
  2. Update tests to reflect https://github.com/pact-foundation/pact-go/blob/master/installer/installer_test.go
  3. Create Dockerfile for golang alpine https://github.com/pact-foundation/pact-go/blob/master/Dockerfile
  4. Update Makefile to run either debian or alpine based image

    pact-go/Makefile

    Lines 39 to 58 in a1e63fc

    docker_build:
    docker build -f Dockerfile --build-arg GO_VERSION=${GO_VERSION} -t pactfoundation/pact-go-test .
    docker_test: docker_build
    docker run \
    -e LOG_LEVEL=INFO \
    --rm \
    pactfoundation/pact-go-test \
    /bin/sh -c "make test"
    docker_pact: docker_build
    docker run \
    -e LOG_LEVEL=INFO \
    --rm \
    pactfoundation/pact-go-test \
    /bin/sh -c "make pact_local"
    docker_test_all: docker_build
    docker run \
    -e LOG_LEVEL=INFO \
    --rm \
    pactfoundation/pact-go-test \
    /bin/sh -c "make test && make pact_local"
  5. Update CI to test amd64 alpine variant
    test-containers:
    runs-on: ubuntu-latest
    name: ${{ matrix.go-version }}-test-container
    strategy:
    fail-fast: false
    matrix:
    go-version: ["1.21", "1.22"]
    steps:
    - uses: actions/checkout@v4
    - name: Test dockerfile
    run: make docker_test_all
    env:
    GO_VERSION: ${{ matrix.go-version }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions