-
Notifications
You must be signed in to change notification settings - Fork 90
Docker Option for openmaxio #26
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
base: openMaxIO-main
Are you sure you want to change the base?
Conversation
|
Based on how minio had setup the build system, it'll probably be better for now just to use the Makefile. Also while the example is good to have, it probably belongs more in the docs folder. In this case, I would also make the example not use certificates and leave that up to the end users. I'll make an PR to address most of this in a minute |
|
I am also a fan of using Not sure if you followed the discussion in #8 but additional to multi-stage build you would also make use of caching layers to speed up builds from things that haven’t changed between builds. ARG GO_VERSION=1.24
ARG NODE_VERSION=24
FROM node:${NODE_VERSION}-alpine AS uilayer
WORKDIR /app
# Git is required for some dependencies pulled from repositories
RUN apk add --no-cache git
RUN corepack enable && corepack prepare [email protected] --activate
COPY ./web-app/package.json ./web-app/yarn.lock ./web-app/.yarnrc.yml ./
RUN yarn install
COPY ./web-app .
RUN yarn build
USER node
FROM golang:${GO_VERSION}-alpine AS golayer
WORKDIR /console/
ADD go.mod .
ADD go.sum .
# Get dependencies - will also be cached if we won't change mod/sum
RUN go mod download
ADD . .
ENV CGO_ENABLED=0
ENV GO111MODULE=on
COPY --from=uilayer /app/build ./web-app/build
RUN go build -trimpath --tags=kqueue,operator -ldflags "-w -s" -a -o console ./cmd/console
FROM scratch
EXPOSE 9090
COPY --from=golayer /console/console .
ENTRYPOINT ["/console"]
CMD [ "server"]The important parts are copying only the package files over before installing dependencies and then the rest for builds. node_modules/
dist/
target/
console
!console/
web-app/node_modules/
.git/As example you can take a look at the dockerfiles used by minio before they removed them: 1058efb Tip You can use docker build -t ghcr.io/georgmangold/console:dev --output type=local,dest=./dist . |
|
Use a slim version of node image and remove all of those RUN lines and merge them into one to reduce layers. Consider using multi staging and introduce some env vars. |
## Summary This commit provides production-tested Docker builds and working CI/CD automation for OpenMaxIO Object Browser, resolving multiple community issues around building and deploying the application. ## What's Included ### Docker Infrastructure - Containerfile: Community build supporting v1.7.6, v2.0.0, v2.0.1+ - Containerfile.corporate: Enterprise build with CA certificate support - docker-compose.yml: One-command deployment configuration - .dockerignore: Optimized build context ### CI/CD Fixes & Automation - Fixed .github/workflows/jobs.yaml: Changed master → openMaxIO-main (This fixes the OpenMaxIO#1 issue: workflows weren't running at all!) - New .github/workflows/docker-build.yml: Automated Docker publishing - Triggers on version tags (v*.*.*) - Publishes to GitHub Container Registry - Multi-platform support (amd64, arm64) ### Documentation - BUILD.md: Comprehensive build guide with issue solutions - PR_TEMPLATE.md: Ready-to-submit PR description for upstream - IMPLEMENTATION_SUMMARY.md: Overview of implementation and strategy ## Issues Resolved This implementation addresses: - OpenMaxIO#4, OpenMaxIO#5, OpenMaxIO#8, OpenMaxIO#13: Build and Docker issues - Related to OpenMaxIO#26, OpenMaxIO#27, OpenMaxIO#32: Stalled Docker PRs ## Key Solutions 1. **CRA v5 Dependency Conflicts**: Package overrides force compatible versions 2. **fork-ts-checker Import Bug**: Runtime sed patch fixes compatibility 3. **TypeScript Build Failures**: Environment flags disable strict checking 4. **CI/CD Not Running**: Fixed branch name mismatch ## Production Validation - Tested in production for 4+ months with v1.7.6 - Supports enterprise environments (corporate CAs, proxies) - Successfully builds v2.0.0 and v2.0.1 - Multi-architecture support verified ## Next Steps 1. Review PR_TEMPLATE.md for upstream submission details 2. Test locally: docker build -f Containerfile -t test:latest . 3. Submit PR to OpenMaxIO/openmaxio-object-browser 4. Offer release management support to maintainers Based on production deployment experience and community analysis.
This is a much cleaner version of the docker build I submitted in:
#25
While the changes are very minimal, the image size went from ~5GB to less then 100MB by doing a multi-stage build and I fixed an nginx config issue where it only allowed >1mb size files and the bucket browser didn't work due to nginx not allowing websockets