diff --git a/.github/workflows/build_and_publish_images.yml b/.github/workflows/build_and_publish_images.yml new file mode 100644 index 0000000..2ed902c --- /dev/null +++ b/.github/workflows/build_and_publish_images.yml @@ -0,0 +1,47 @@ +name: build image and push image to dockerhub & ghcr.io + +on: + workflow_dispatch: + push: + branches: + - 'main' + +jobs: + docker_ubuntu_2204: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_TOKEN }} + - + name: Build and push latest + uses: docker/build-push-action@v5.1.0 + with: + file: ubuntu/22.04.Dockerfile + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ github.repository_owner }}/erlang_elixir_vfox_ubuntu_container:latest + ghcr.io/${{ github.repository_owner }}/erlang_elixir_vfox_ubuntu_container:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/README.md b/README.md new file mode 100644 index 0000000..19099a9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# erlang_elixir_vfox_ubuntu_container + +erlang & elixir & vfox base image \ No newline at end of file diff --git a/ubuntu/22.04.Dockerfile b/ubuntu/22.04.Dockerfile new file mode 100644 index 0000000..7207558 --- /dev/null +++ b/ubuntu/22.04.Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Asia/Shanghai + +RUN apt-get update -y && apt-get upgrade -y +RUN apt-get install -y \ + software-properties-common \ + build-essential \ + apt-transport-https \ + unzip \ + sudo \ + locales \ + iputils-ping \ + git \ + curl \ + wget \ + sysstat \ + libssl-dev \ + make \ + automake \ + autoconf \ + libncurses5-dev \ + gcc \ + xsltproc \ + fop \ + libxml2-utils \ + libwxgtk3.0-gtk3-dev \ + unixodbc \ + unixodbc-dev \ + m4 \ + default-jdk \ + tzdata \ + net-tools + +RUN locale-gen en_US en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US.UTF-8 + +# C++ 17 support for enable JIT +RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y \ + && apt-get update -y \ + && apt-get install gcc-9 g++-9 -y \ + && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + +# beautify terminal +RUN wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh \ + && chmod +x /usr/local/bin/oh-my-posh \ + && mkdir /root/.poshthemes \ + && wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O /root/.poshthemes/themes.zip \ + && unzip /root/.poshthemes/themes.zip -d /root/.poshthemes \ + && chmod u+rw /root/.poshthemes/*.omp.* \ + && rm /root/.poshthemes/themes.zip \ + && echo 'eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/emodipt-extend.omp.json)"' >> /root/.bashrc +# Remember install fonts +# oh-my-posh font install + +RUN echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list \ + && apt-get update \ + && apt-get install -y vfox + +ENV ERLANG_VERSION=26.2.5 +ENV ELIXIR_VERSION=1.16.2 +ENV MAKEFLAGS=-j8 +RUN vfox add erlang \ + && vfox add elixir \ + && vfox install erlang@${ERLANG_VERSION} \ + && vfox install elixir@${ELIXIR_VERSION} + +RUN echo 'root:EnjoyLife' | chpasswd \ No newline at end of file