GithubHelp home page GithubHelp logo

Comments (6)

SkYNewZ avatar SkYNewZ commented on July 18, 2024 1

This is mine :) running on k3s on Raspberrypi 4

FROM phntxx/dashboard as builder
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=builder /app /usr/share/nginx/html

With

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: dashboard
  name: dashboard
  namespace: dashboard
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dashboard
      app.kubernetes.io/part-of: dashboard
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dashboard
        app.kubernetes.io/part-of: dashboard
    spec:
      containers:
      - image: rg.fr-par.scw.cloud/cc2b5a5b-09f9-4378-afd3-badc4b2865ac/phntxx/dashboard:latest
        name: dashboard
        ports:
        - containerPort: 8080
          name: http
        resources:
          limits:
            cpu: 100m
            memory: 128Mi
          requests:
            cpu: 100m
            memory: 128Mi
        volumeMounts:
        - mountPath: /usr/share/nginx/html/data
          name: config
          readOnly: true
      restartPolicy: Always
      volumes:
      - configMap: # contains the JSON files, autogenerated with kustomize from a yaml file (more readable)
          name: config-562662tg42
        name: config

from dashboard.

leonbeon avatar leonbeon commented on July 18, 2024

This is mine :) running on k3s on Raspberrypi 4

FROM phntxx/dashboard as builder
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=builder /app /usr/share/nginx/html

Ah, so simple! Thanks!

from dashboard.

SkYNewZ avatar SkYNewZ commented on July 18, 2024

I'd rather say "optimized" 😋

from dashboard.

phntxx avatar phntxx commented on July 18, 2024

While I do like making this available out of the box, I struggle doing so.

I've managed getting multiarch images for ratisbonacoding/nginx-cloudflare-cache built yesterday.

The issue I'm facing lies within the fact that the node:lts image is used for building, followed by the ratisbonacoding/nginx-cloudflare-cache image, which is based on nginxinc/nginx-unprivileged:alpine.
If anyone here has expertise with docker buildx and knows how to help me out with the following, I'd really appreciate your input:

If we look at the Dockerfile for this project:

FROM node:lts AS build

WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install

COPY . ./
RUN yarn build

FROM ratisbonacoding/nginx-cloudflare-cache
COPY --from=build /app/build /app
COPY nginx.conf /etc/nginx/nginx.conf

I'd like everything until RUN yarn build to run on one platform and everything after to be built for multiple architectures.

from dashboard.

SkYNewZ avatar SkYNewZ commented on July 18, 2024

Hello. You can do this with this Dockerfile :) This will only be available throught docker buildx build.

-FROM node:lts AS build
+FROM --platform=$TARGETPLATFORM node:lts AS build

WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install

COPY . ./
RUN yarn build

-FROM ratisbonacoding/nginx-cloudflare-cache
+FROM --platform=$TARGETPLATFORM ratisbonacoding/nginx-cloudflare-cache
COPY --from=build /app/build /app
COPY nginx.conf /etc/nginx/nginx.conf

Then. It should work

docker buildx create --name builder --use
docker buildx build --plateform linux/amd64,linux/arm/v7 --push --tag docker.io/phntxx/dashboard

EDIT: I think the --platform=$TARGETPLATFORM is optionnal here, you can try both

https://docs.docker.com/buildx/working-with-buildx/

from dashboard.

phntxx avatar phntxx commented on July 18, 2024

I've recently discovered that my buildx configuration works, so there should now be an ARM image of this project available on Docker.

Closing.

from dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.