Comments (4)
I guess, alpine, debian (or ubuntu) fit best for a container base image.
From what I'm reading, your issue is solved, so I can close this?
from arch-mojo.
Have you tried the Dockerfile from modular? I haven't tried it, but it should work on arch since it is docker
from arch-mojo.
I have sone issues with, but I was to build my own docker using ubuntu as below:
.env file:
MODULAR_AUTH_KEY=mut_a2ffxxxxxxxxxxxxxxxxxx8f
auth_script.sh file:
#!/bin/bash
# Read the MODULAR_AUTH_KEY from the .env file and execute modular auth
export $(cat .env | xargs) && \
modular auth $MODULAR_AUTH_KEY
Dockerfile.mojosdk:
# Use the latest Ubuntu base image
FROM ubuntu:latest
# Set environment variable to avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Set working directory inside the container
WORKDIR /app
# Copy necessary files into the container
COPY auth_script.sh .
COPY .env .
# Update package lists and install required packages
RUN apt-get update && \
apt-get install -y \
software-properties-common \
gnupg \
git \
curl \
wget \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& set -eux; \
# Add Python 3.10 repository and install dependencies
add-apt-repository ppa:deadsnakes/ppa -y \
&& keyring_location=/usr/share/keyrings/modular-installer-archive-keyring.gpg \
&& curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/gpg.0E4925737A3895AD.key' | gpg --dearmor >> ${keyring_location} \
&& curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/config.deb.txt?distro=debian&codename=wheezy' > /etc/apt/sources.list.d/modular-installer.list \
&& apt-get update \
&& apt install -y python3.10 python3.10-venv \
&& apt-get install -y modular \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
# Set environment variables for Mojo installation
&& echo 'export MODULAR_HOME="/root/.modular"' >> ~/.bashrc \
&& echo 'export PATH="/root/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc \
&& /bin/bash -c "source ~/.bashrc" \
# Clean up and set permissions
&& modular clean \
&& chmod +x auth_script.sh \
&& ./auth_script.sh \
&& modular install mojo \
&& pip install --upgrade pip
# Clean up unnecessary packages and files
RUN apt-get remove -y \
software-properties-common \
gnupg \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get purge -y --auto-remove
# Remove the copied script and environment file
RUN rm auth_script.sh .env
# Expose port 80 for external access
EXPOSE 80
# Set default entrypoint and command for the container
ENTRYPOINT ["tail"]
CMD ["-f", "/dev/null"]
Build the container:
docker build -t mojo-sdk:r0.6 -f Dockerfile.mojosdk --no-cache .
Create a volume for the projects:
docker volume create mojoProjects
Create and run the develi=opment container, and map it with the docker volme
docker run -d --publish 3000:80 --name mojo-dev --mount source=mojoProjects,target=/app mojo-sdk:r0.6
The generated image size is 1256 MB, and it is working very well.
I'm just excited if docker image of the same can be built using Archlinux docker image as a base. Thanks
from arch-mojo.
Thanks a lot, yes you can close it, I just created a repository of my working if any one here is interested. https://github.com/hajsf/mojo-docker/tree/main
from arch-mojo.
Related Issues (15)
- Failure writing output to destination HOT 25
- reading ~/.zshrc fails HOT 2
- ERROR: Failure while downloading - curl: (22) The requested URL returned error: 404 HOT 3
- Install Script Depends On Modular HOT 1
- Failed to build modular. One or more files did not pass the validity check. HOT 1
- Starting from clean install (manually deleted all modular/mojo related folders) it fails somehow. Maybe somebody is encountering the same issue HOT 7
- encountered an error HOT 1
- ==> ERROR: install file (modular.install) does not exist or is not a regular file. /bin/sh: line 1: modular: command not found Failed to authenticate modular using token: '' HOT 2
- Error related to virtual environment HOT 3
- Working with Jupyter notebook HOT 4
- Authentication not working. HOT 10
- Reading the MODULAR_AUTH from argument or .env HOT 1
- Issue with the symbolic links for the libraries used globally HOT 5
- Update modular to `0.3.0` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arch-mojo.