Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker.alpine alternative image #1512

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add Docker.alpine alternative image #1512

wants to merge 1 commit into from

Conversation

jjcarstens
Copy link
Collaborator

For #1427

This builds and starts locally, though I am not Docker-smart enough to actually load a webpage from it.

I believe we could build this alongside with the ubuntu image for a while, maybe with an -alpine tag. But I haven't figured out how to add that to the workflow yet.

/cc @rraub

@joshk
Copy link
Collaborator

joshk commented Sep 11, 2024

Very cool.

Looking into the Docker build and push action, you should be able to add this after the current one in ci.yml:

     - name: Extract metadata (tags, labels) for Docker (Alpine image)
        id: alpine-meta
        uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
        with:
          images: ghcr.io/nerves-hub/nerves-hub-alpine
          tags: |
            # short sha
            type=sha,enable={{is_default_branch}},prefix=,suffix=,format=short
            # branch image names, except for main
            type=ref,enable=${{ github.ref != format('refs/heads/{0}', 'main') }},event=branch
            # latest tag for main branch
            type=raw,enable={{is_default_branch}},value=latest
            # tag event (eg. "v1.2.3")
            type=ref,event=tag

     - name: Build and push Docker image (Alpine)
        uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
        with:
          context: .
          file: Docker.alpine
          push: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }}
          tags: ${{ steps.alpine-meta.outputs.tags }}
          labels: ${{ steps.alpine-meta.outputs.labels }}

Copy link
Contributor

@oestrich oestrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would work. Publishing both would be pretty cool

RUN apk update \
&& apk add --no-cache fwup openssl bash openssl curl jq xdelta3 \
zip unzip wget musl-locales musl-locales-lang libstdc++
# Is this needed? libncurses6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is for something related to iex maybe... but I'm not sure. Seems fine to skip for now

Comment on lines +50 to +51
# Is this cleanup still needed?
# && apt-get clean && rm -f /var/lib/apt/lists/*_*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Is this cleanup still needed?
# && apt-get clean && rm -f /var/lib/apt/lists/*_*

Nope, drop it!

Comment on lines +103 to +104
# Do we need to clean things?
# && apt-get clean && rm -rf /var/lib/apt/lists/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Do we need to clean things?
# && apt-get clean && rm -rf /var/lib/apt/lists/*

Nope, drop it!

@joshk
Copy link
Collaborator

joshk commented Dec 7, 2024

@jjcarstens did you want to finish this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants