-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dockerfile #9
Comments
Have you tried the Dockerfile from modular? I haven't tried it, but it should work on arch since it is docker |
I have sone issues with, but I was to build my own docker using ubuntu as below:
auth_script.sh file:
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:
Create a volume for the projects:
Create and run the develi=opment container, and map it with the docker volme
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 |
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? |
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 |
I'm trying to build a docker file for mojo lang, it was done smoothly using Ubuntu vase image as:
And I tried to do the same based on archlinux base image, but I struggled in that, I updated the
install.py
file to be:And wrote the Dockerfile as:
But i got the below at the last stage:
Can you help in this please. thanks
The text was updated successfully, but these errors were encountered: