Skip to content

Commit

Permalink
feat(#1): start
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Sep 10, 2024
0 parents commit 85b84e5
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: docker
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
pull_request:
jobs:
docker:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: docker build . -t home
- run: docker run --rm home echo Hello
11 changes: 11 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: hadolint
on:
push:
pull_request:
jobs:
hadolint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: hadolint/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile.log
134 changes: 134 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# The MIT License (MIT)
#
# Copyright (c) 2024 Aliaksei Bialiauski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM ubuntu:22.04
LABEL Description="Lightweight image with Rust for Rultor.com" Version="0.0.0"

Check failure on line 24 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3048 style: Invalid label key.
WORKDIR /tmp

ENV DEBIAN_FRONTEND=noninteractive

# To disable IPv6
RUN mkdir ~/.gnupg \
&& printf "disable-ipv6" >> ~/.gnupg/dirmngr.conf

# UTF-8 locale
RUN apt-get clean \

Check failure on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

SC2028 info: echo may not expand escape sequences. Use printf.

Check failure on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`
&& apt-get update -y --fix-missing \
&& apt-get -y install locales \
&& locale-gen en_US.UTF-8 \
&& dpkg-reconfigure locales \
&& echo "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8\nLANGUAGE=en_US.UTF-8" > /etc/default/locale \
&& echo 'export LC_ALL=en_US.UTF-8' >> /root/.profile \
&& echo 'export LANG=en_US.UTF-8' >> /root/.profile \
&& echo 'export LANGUAGE=en_US.UTF-8' >> /root/.profile

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Basic Linux tools
RUN apt-get -y --no-install-recommends install wget \

Check failure on line 49 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
vim \
curl \
sudo \
unzip \
zip \
gnupg2 \
jq \
netcat-openbsd \
bsdmainutils \
libcurl4-gnutls-dev \
libxml2-utils \
libjpeg-dev \
aspell \
ghostscript \
inkscape \
build-essential \
automake \
autoconf \
chrpath \
libxft-dev \
libfreetype6 \
libfreetype6-dev \
libfontconfig1 \
libfontconfig1-dev \
software-properties-common

# Git 2.0
RUN add-apt-repository ppa:git-core/ppa \

Check failure on line 77 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3009 info: Delete the apt-get lists after installing something

Check failure on line 77 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& apt-get update -y --fix-missing \
&& apt-get -y --no-install-recommends install git \
&& bash -c 'git --version'

# SSH Daemon
RUN apt-get -y install ssh \

Check failure on line 83 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`

Check failure on line 83 in Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& mkdir /var/run/sshd \
&& chmod 0755 /var/run/sshd

# Java
ENV MAVEN_OPTS "-Xmx1g"
ENV JAVA_OPTS "-Xmx1g"
ENV JAVA_HOME "/usr/lib/jvm/java-17"
RUN apt-get -y install ca-certificates openjdk-11-jdk openjdk-17-jdk \
&& update-java-alternatives --set $(ls /usr/lib/jvm | grep java-1.11) \
&& ln -s "/usr/lib/jvm/$(ls /usr/lib/jvm | grep java-1.11)" /usr/lib/jvm/java-11 \
&& ln -s "/usr/lib/jvm/$(ls /usr/lib/jvm | grep java-1.17)" /usr/lib/jvm/java-17 \
&& echo 'export JAVA_HOME=/usr/lib/jvm/java-11' >> /root/.profile \
&& bash -c '[[ "$(javac --version)" =~ "11.0" ]]'

# Maven
ENV MAVEN_VERSION 3.9.6
ENV M2_HOME "/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}"
RUN echo 'export M2_HOME=/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}' >> /root/.profile \
&& wget --quiet "https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" \
&& mkdir -p /usr/local/apache-maven \
&& mv "apache-maven-${MAVEN_VERSION}-bin.tar.gz" /usr/local/apache-maven \
&& tar xzvf "/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C /usr/local/apache-maven/ \
&& update-alternatives --install /usr/bin/mvn mvn "${M2_HOME}/bin/mvn" 1 \
&& update-alternatives --config mvn \
&& mvn -version \
&& bash -c '[[ "$(mvn --version)" =~ "${MAVEN_VERSION}" ]]'
COPY settings.xml /root/.m2/settings.xml

# NodeJS
RUN rm -rf /usr/lib/node_modules \
&& curl -sL https://deb.nodesource.com/setup_18.x -o /tmp/nodesource_setup.sh \
&& bash /tmp/nodesource_setup.sh \
&& apt-get -y install nodejs \
&& bash -c 'node --version' \
&& bash -c 'npm --version'

# Rust and Cargo.
ENV PATH="${PATH}:${HOME}/.cargo/bin"
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y \
&& echo 'export PATH=${PATH}:${HOME}/.cargo/bin' >> /root/.profile \
&& ${HOME}/.cargo/bin/rustup toolchain install stable \
&& bash -c '"${HOME}/.cargo/bin/cargo" --version'

# Clean up
RUN rm -rf /tmp/* \
/root/.ssh \
/root/.cache \
/root/.wget-hsts \
/root/.gnupg

ENTRYPOINT ["/bin/bash", "--login", "-c"]
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Aliaksei Bialiauski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}

0 comments on commit 85b84e5

Please sign in to comment.