diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 724c5b7..eb34fe8 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -25,7 +25,7 @@ jobs: env echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json sudo service docker restart - docker build --squash --tag septimalmind/izumi-env:latest --tag septimalmind/izumi-env:${GITHUB_REF_SLUG} --tag septimalmind/izumi-env:${GITHUB_SHA} izumi-env-build + docker build --squash --tag septimalmind/izumi-env:latest --tag septimalmind/izumi-env:${GITHUB_REF_SLUG} --tag septimalmind/izumi-env:${GITHUB_SHA} . -f Dockerfile.izumi-env-build echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker push septimalmind/izumi-env:latest docker push septimalmind/izumi-env:${GITHUB_REF_SLUG} @@ -53,7 +53,7 @@ jobs: env echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json sudo service docker restart - docker build --squash --tag septimalmind/izumi-env-light:latest --tag septimalmind/izumi-env-light:${GITHUB_REF_SLUG} --tag septimalmind/izumi-env-light:${GITHUB_SHA} izumi-env-runtime + docker build --squash --tag septimalmind/izumi-env-light:latest --tag septimalmind/izumi-env-light:${GITHUB_REF_SLUG} --tag septimalmind/izumi-env-light:${GITHUB_SHA} . -f Dockerfile.izumi-env-runtime echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker push septimalmind/izumi-env-light:latest docker push septimalmind/izumi-env-light:${GITHUB_REF_SLUG} diff --git a/izumi-env-build/Dockerfile b/Dockerfile.izumi-env-build similarity index 65% rename from izumi-env-build/Dockerfile rename to Dockerfile.izumi-env-build index 5b132bc..2e1ba74 100644 --- a/izumi-env-build/Dockerfile +++ b/Dockerfile.izumi-env-build @@ -1,50 +1,21 @@ +# syntax = edrevo/dockerfile-plus + ARG V_UBUNTU=22.04 FROM ubuntu:${V_UBUNTU} ARG URELEASE=jammy -### -ARG V_GRAAL=21.0.2 -ARG V_SCALA=2.13.12 -ARG V_SBT=1.9.8 - -ARG V_TYPESCRIPT=4.0.2 -ARG V_GOLANG=1.21 -ARG V_DOTNETSDK=7.0 -ARG V_MVN=3.6.3-5 -ARG V_PROTOBUF=25.1 -ARG V_JEKYLL=3.2.1 -### - -# basic configuration -RUN mkdir -p /work -RUN mkdir -p /root -VOLUME /work -VOLUME /root -WORKDIR /work - -ENV DEBIAN_FRONTEND noninteractive -RUN echo "APT::Acquire::Queue-Mode "access"; APT::Acquire::Retries 3; " > /etc/apt/apt.conf.d/99parallel - -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +INCLUDE+ lib/Dockerfile.common -RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y --no-install-recommends tzdata gnupg ca-certificates wget curl zip unzip apt-utils jq openssh-client software-properties-common +INCLUDE+ lib/Dockerfile.common-java -RUN apt-get -y --no-install-recommends install locales -RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen +INCLUDE+ lib/Dockerfile.common-dotnet -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata -# end: basic configuration -# sources -RUN curl -o packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb && \ - dpkg -i packages-microsoft-prod.deb && \ - rm packages-microsoft-prod.deb +# +RUN apt-get install -y --no-install-recommends build-essential git +# +# sources RUN add-apt-repository ppa:longsleep/golang-backports RUN curl -sS https://download.mono-project.com/repo/xamarin.gpg | apt-key add - && \ @@ -66,15 +37,11 @@ RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E4 echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \ echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list -RUN apt-get update && apt-get upgrade -y +RUN apt-get update # end: sources - -# we don't need it but it fixes broken apt -#RUN apt-get install -y openjdk-21-jre-headless - RUN apt-get install -y --no-install-recommends \ - mono-devel nuget nunit-console dotnet-sdk-${V_DOTNETSDK} msbuild + mono-devel nuget nunit-console msbuild RUN apt-get install -y --no-install-recommends \ nodejs yarn @@ -96,25 +63,9 @@ RUN apt-get install -y --no-install-recommends \ RUN apt-get install -y --no-install-recommends \ maven=${V_MVN} - RUN apt-get install -y --no-install-recommends \ ruby ruby-dev -# java -ARG JAVA_BASE=/usr/lib/jvm -ENV JAVA_HOME ${JAVA_BASE}/graalvm -ENV PATH "$PATH:$JAVA_HOME/bin" - -RUN cd /tmp && \ - wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${V_GRAAL}/graalvm-community-jdk-${V_GRAAL}_linux-x64_bin.tar.gz -O dist.tar.gz && \ - tar -xvzf dist.tar.gz && \ - rm -f dist.tar.gz && \ - mkdir -p ${JAVA_BASE} && \ - chmod -R 755 ${JAVA_BASE} && \ - mv graalvm-*/ ${JAVA_HOME} && \ - update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 99999 -# end: java - RUN wget -q www.scala-lang.org/files/archive/scala-${V_SCALA}.deb && dpkg -i --ignore-depends=java8-runtime-headless scala-${V_SCALA}.deb && rm -rf *.deb && \ curl -Lo /usr/local/bin/coursier https://git.io/coursier-cli && chmod +x /usr/local/bin/coursier @@ -132,6 +83,10 @@ RUN gem install sass && \ ENV GOPATH $HOME/gopath ENV PATH $HOME/gopath/bin:/usr/lib/go-${V_GOLANG}/bin:$PATH +ENV PB_REL="https://github.com/protocolbuffers/protobuf/releases" +RUN curl -LO $PB_REL/download/v${V_PROTOBUF}/protoc-${V_PROTOBUF}-linux-x86_64.zip && unzip protoc-${V_PROTOBUF}-linux-x86_64.zip -d /usr/proto +RUN mv /usr/proto/bin/protoc /usr/bin/protoc && mv /usr/proto/include /usr/bin/include && chmod +x /usr/bin/protoc + RUN echo "java: $(java -version)" && \ echo "java: $(native-image --version)" && \ echo "scalac: $(scalac -version)" && \ @@ -143,10 +98,8 @@ RUN echo "java: $(java -version)" && \ echo "node: $(node -v)" && \ echo "yarn: $(yarn -v)" && \ echo "jekyll: $(jekyll -v)" && \ + echo "protoc: $(protoc --version)" && \ sbt about -ENV PB_REL="https://github.com/protocolbuffers/protobuf/releases" -RUN curl -LO $PB_REL/download/v${V_PROTOBUF}/protoc-${V_PROTOBUF}-linux-x86_64.zip && unzip protoc-${V_PROTOBUF}-linux-x86_64.zip -d /usr/proto -RUN mv /usr/proto/bin/protoc /usr/bin/protoc && mv /usr/proto/include /usr/bin/include && chmod +x /usr/bin/protoc - +RUN apt-get update && apt-get upgrade -y RUN apt-get clean -y diff --git a/Dockerfile.izumi-env-runtime b/Dockerfile.izumi-env-runtime new file mode 100644 index 0000000..cae78ac --- /dev/null +++ b/Dockerfile.izumi-env-runtime @@ -0,0 +1,22 @@ +# syntax = edrevo/dockerfile-plus + +ARG V_UBUNTU=22.04 +FROM ubuntu:${V_UBUNTU} +ARG URELEASE=jammy + +INCLUDE+ lib/Dockerfile.common + +INCLUDE+ lib/Dockerfile.common-java + +INCLUDE+ lib/Dockerfile.common-dotnet + +# dotnet +ENV PATH "$PATH:/.dotnet/tools" +RUN dotnet --version && \ + dotnet tool install Amazon.Lambda.Tools --tool-path /.dotnet/tools && \ + dotnet new -i Amazon.Lambda.Templates +# end: dotnet + +ENV PATH "$PATH:/app" + +RUN apt-get clean -y diff --git a/izumi-env-runtime/Dockerfile b/izumi-env-runtime/Dockerfile deleted file mode 100644 index 149ab65..0000000 --- a/izumi-env-runtime/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -ARG V_UBUNTU=22.04 -FROM ubuntu:${V_UBUNTU} -ARG URELEASE=jammy - -### -ARG V_GRAAL=21.0.2 -ARG V_DOTNETSDK=7.0 -### - -# basic configuration -RUN mkdir -p /work -RUN mkdir -p /root -VOLUME /work -VOLUME /root -WORKDIR /work - -ENV DEBIAN_FRONTEND noninteractive -RUN echo "APT::Acquire::Queue-Mode "access"; APT::Acquire::Retries 3; " > /etc/apt/apt.conf.d/99parallel - -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y --no-install-recommends tzdata gnupg ca-certificates wget curl zip unzip apt-utils jq openssh-client software-properties-common - -RUN apt-get -y --no-install-recommends install locales -RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata -# end: basic configuration - -# java -ARG JAVA_BASE=/usr/lib/jvm -ENV JAVA_HOME ${JAVA_BASE}/graalvm -ENV PATH "$PATH:$JAVA_HOME/bin" - -RUN cd /tmp && \ - wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${V_GRAAL}/graalvm-community-jdk-${V_GRAAL}_linux-x64_bin.tar.gz -O dist.tar.gz && \ - tar -xvzf dist.tar.gz && \ - rm -f dist.tar.gz && \ - mkdir -p ${JAVA_BASE} && \ - chmod -R 755 ${JAVA_BASE} && \ - mv graalvm-*/ ${JAVA_HOME} && \ - update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 99999 && \ - java --version -# end: java - -# dotnet -ENV PATH "$PATH:/.dotnet/tools" - -ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -RUN printf 'Package: *\nPin: origin "packages.microsoft.com"\nPin-Priority: 1001' > /etc/apt/preferences.d/99microsoft-dotnet.pref - -RUN curl -o packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb && \ - dpkg -i packages-microsoft-prod.deb && \ - rm packages-microsoft-prod.deb - -RUN apt-get update && apt-get install -y apt-transport-https dotnet-sdk-${V_DOTNETSDK} aspnetcore-runtime-${V_DOTNETSDK} && apt-get upgrade -y - -RUN dotnet --version && \ - dotnet tool install Amazon.Lambda.Tools --tool-path /.dotnet/tools && \ - dotnet new -i Amazon.Lambda.Templates -# end: dotnet - -ENV PATH "$PATH:/app" -RUN apt-get clean -y diff --git a/lib/Dockerfile.common b/lib/Dockerfile.common new file mode 100644 index 0000000..8cce002 --- /dev/null +++ b/lib/Dockerfile.common @@ -0,0 +1,52 @@ +### Both envs +ARG V_GRAAL=21.0.2 +ARG V_DOTNETSDK=7.0 +### + +### Build env only +ARG V_SCALA=2.13.12 +ARG V_SBT=1.9.8 + +ARG V_TYPESCRIPT=4.0.2 +ARG V_GOLANG=1.21 +ARG V_MVN=3.6.3-5 +ARG V_PROTOBUF=25.1 +ARG V_JEKYLL=3.2.1 +### + +# basic configuration +RUN mkdir -p /work +RUN mkdir -p /root +VOLUME /work +VOLUME /root +WORKDIR /work + +ENV DEBIAN_FRONTEND noninteractive +RUN echo "APT::Acquire::Queue-Mode "access"; APT::Acquire::Retries 3; " > /etc/apt/apt.conf.d/99parallel + +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +RUN apt-get update && apt-get upgrade -y +RUN apt-get install -y --no-install-recommends \ + tzdata \ + gnupg \ + ca-certificates \ + wget \ + curl \ + zip \ + unzip \ + apt-utils \ + jq \ + openssh-client \ + software-properties-common \ + apt-transport-https + +RUN apt-get -y --no-install-recommends install locales +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen + +RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata +# end: basic configuration diff --git a/lib/Dockerfile.common-dotnet b/lib/Dockerfile.common-dotnet new file mode 100644 index 0000000..b67479e --- /dev/null +++ b/lib/Dockerfile.common-dotnet @@ -0,0 +1,12 @@ +# dotnet +ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 +RUN printf 'Package: *\nPin: origin "packages.microsoft.com"\nPin-Priority: 1001' > /etc/apt/preferences.d/99microsoft-dotnet.pref + +RUN curl -o packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb && \ + dpkg -i packages-microsoft-prod.deb && \ + rm packages-microsoft-prod.deb + +RUN apt-get update && apt-get install -y dotnet-sdk-${V_DOTNETSDK} aspnetcore-runtime-${V_DOTNETSDK} && apt-get upgrade -y + +RUN echo "dotnet: $(dotnet --version)" +# end: dotnet diff --git a/lib/Dockerfile.common-java b/lib/Dockerfile.common-java new file mode 100644 index 0000000..3505bc7 --- /dev/null +++ b/lib/Dockerfile.common-java @@ -0,0 +1,22 @@ +# java +ARG JAVA_BASE=/usr/lib/jvm +ENV JAVA_HOME ${JAVA_BASE}/graalvm +ENV PATH "$PATH:$JAVA_HOME/bin" + +RUN cd /tmp && \ + wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${V_GRAAL}/graalvm-community-jdk-${V_GRAAL}_linux-x64_bin.tar.gz -O dist.tar.gz && \ + tar -xvzf dist.tar.gz && \ + rm -f dist.tar.gz && \ + mkdir -p ${JAVA_BASE} && \ + chmod -R 755 ${JAVA_BASE} && \ + mv graalvm-*/ ${JAVA_HOME} && \ + update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 99999 + +RUN echo "java: $(java -version)" && \ + echo "java: $(native-image --version)" + +# we don't need it but it fixes broken apt +#RUN apt-get install -y openjdk-21-jre-headless + +# end: java +