Skip to content

Commit

Permalink
inclusions, build env fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pshirshov committed Jan 18, 2024
1 parent 34ee9cd commit c8d08f5
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 135 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
81 changes: 17 additions & 64 deletions izumi-env-build/Dockerfile → Dockerfile.izumi-env-build
Original file line number Diff line number Diff line change
@@ -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 - && \
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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)" && \
Expand All @@ -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
22 changes: 22 additions & 0 deletions Dockerfile.izumi-env-runtime
Original file line number Diff line number Diff line change
@@ -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
69 changes: 0 additions & 69 deletions izumi-env-runtime/Dockerfile

This file was deleted.

52 changes: 52 additions & 0 deletions lib/Dockerfile.common
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions lib/Dockerfile.common-dotnet
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions lib/Dockerfile.common-java
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c8d08f5

Please sign in to comment.