Skip to content

Commit

Permalink
feat: ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson Veroneze committed Apr 26, 2023
1 parent 6c8ac71 commit 63c8a7e
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 56 deletions.
10 changes: 5 additions & 5 deletions Aspnet/Alpine/Dockerfile-7
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
ARG USERNAME=app
ARG APP_NAME=app

# Build scripts
COPY script-base-alpine.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

# TZ/LANG envs
ENV TZ=America/Sao_Paulo
ENV LC_ALL pt_BR.UTF-8
ENV LANG pt_BR.UTF-8
ENV LANGUAGE pt_BR.UTF-8
ENV LC_ALL pt_BR.UTF-8

# Build scripts
COPY script-base-alpine.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

ENV APP_DIR=/home/$USERNAME

Expand Down
12 changes: 8 additions & 4 deletions Aspnet/Alpine/Dockerfile-7-xray
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ FROM jacksonveroneze/aspnet:7.0-alpine

USER root

COPY script-install-xray.sh /tmp
# Build scripts
COPY script-install-xray-alpine.sh /tmp/script-install-xray.sh
RUN sh -x /tmp/script-install-xray.sh && rm /tmp/script-install-xray.sh

RUN sh -x /tmp/script-install-xray.sh && \
rm /tmp/script-install-xray.sh
USER $USERNAME

# envs
ENV AWS_XRAY_CONTEXT_MISSING=LOG_ERROR

USER $USERNAME
COPY docker-entrypoint-xray.sh $APP_DIR/docker-entrypoint.sh

ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"]
6 changes: 0 additions & 6 deletions Aspnet/Alpine/script-install-xray.sh

This file was deleted.

10 changes: 5 additions & 5 deletions Aspnet/Debian/Dockerfile-7
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
ARG USERNAME=app
ARG APP_NAME=app

# Build scripts
COPY script-base-debian-like.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

# TZ/LANG envs
ENV TZ=America/Sao_Paulo
ENV LC_ALL pt_BR.UTF-8
ENV LANG pt_BR.UTF-8
ENV LANGUAGE pt_BR.UTF-8
ENV LC_ALL pt_BR.UTF-8

# Build scripts
COPY script-base-debian-like.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

ENV APP_DIR=/home/$USERNAME

Expand Down
12 changes: 8 additions & 4 deletions Aspnet/Debian/Dockerfile-7-xray
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ FROM jacksonveroneze/aspnet:7.0-debian

USER root

COPY script-install-xray.sh /tmp
# Build scripts
COPY script-install-xray-debian-like.sh /tmp/script-install-xray.sh
RUN sh -x /tmp/script-install-xray.sh && rm /tmp/script-install-xray.sh

RUN sh -x /tmp/script-install-xray.sh && \
rm /tmp/script-install-xray.sh
USER $USERNAME

# envs
ENV AWS_XRAY_CONTEXT_MISSING=LOG_ERROR

USER $USERNAME
COPY docker-entrypoint-xray.sh $APP_DIR/docker-entrypoint.sh

ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"]
5 changes: 0 additions & 5 deletions Aspnet/Debian/script-install-xray.sh

This file was deleted.

10 changes: 5 additions & 5 deletions Aspnet/Ubuntu/Dockerfile-7
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
ARG USERNAME=app
ARG APP_NAME=app

# Build scripts
COPY script-base-debian-like.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

# TZ/LANG envs
ENV TZ=America/Sao_Paulo
ENV LC_ALL pt_BR.UTF-8
ENV LANG pt_BR.UTF-8
ENV LANGUAGE pt_BR.UTF-8
ENV LC_ALL pt_BR.UTF-8

# Build scripts
COPY script-base-debian-like.sh /tmp/script-base.sh
RUN sh -x /tmp/script-base.sh && rm /tmp/script-base.sh

ENV APP_DIR=/home/$USERNAME

Expand Down
12 changes: 8 additions & 4 deletions Aspnet/Ubuntu/Dockerfile-7-xray
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ FROM jacksonveroneze/aspnet:7.0-ubuntu

USER root

COPY script-install-xray.sh /tmp
# Build scripts
COPY script-install-xray-debian-like.sh /tmp/script-install-xray.sh
RUN sh -x /tmp/script-install-xray.sh && rm /tmp/script-install-xray.sh

RUN sh -x /tmp/script-install-xray.sh && \
rm /tmp/script-install-xray.sh
USER $USERNAME

# envs
ENV AWS_XRAY_CONTEXT_MISSING=LOG_ERROR

USER $USERNAME
COPY docker-entrypoint-xray.sh $APP_DIR/docker-entrypoint.sh

ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"]
5 changes: 0 additions & 5 deletions Aspnet/Ubuntu/script-install-xray.sh

This file was deleted.

6 changes: 3 additions & 3 deletions Aspnet/build-xray-images.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

#Alpine
docker build -f ./Alpine/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-alpine-xray ./Alpine/
docker build -f ./Alpine/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-alpine-xray .

#Ubuntu
docker build -f ./Ubuntu/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-ubuntu-xray ./Ubuntu/
docker build -f ./Ubuntu/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-ubuntu-xray .

#Debian
docker build -f ./Debian/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-debian-xray ./Debian/
docker build -f ./Debian/Dockerfile-7-xray -t jacksonveroneze/aspnet:7.0-debian-xray .
13 changes: 13 additions & 0 deletions Aspnet/docker-entrypoint-xray.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

OS=$(cat /etc/*-release | egrep "PRETTY_NAME" | cut -d = -f 2 | tr -d '"')

echo "- System Operation: $OS"
echo "- EnvironmentName: $ASPNETCORE_ENVIRONMENT"
echo "- AspNetCoreUrls: $ASPNETCORE_URLS"
echo ""
echo "- Run X-Ray"
/usr/bin/xray -f /var/log/xray-daemon.log &
echo ""
echo "- Run application: $APP_NAME"
dotnet $APP_NAME
3 changes: 2 additions & 1 deletion Aspnet/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
OS=$(cat /etc/*-release | egrep "PRETTY_NAME" | cut -d = -f 2 | tr -d '"')

echo "- System Operation: $OS"
echo "- Run application: $APP_NAME"
echo "- EnvironmentName: $ASPNETCORE_ENVIRONMENT"
echo "- AspNetCoreUrls: $ASPNETCORE_URLS"
echo ""
echo "- Run application: $APP_NAME"
echo ""
dotnet $APP_NAME
5 changes: 4 additions & 1 deletion Aspnet/script-base-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

apk update && \
apk upgrade && \
apk add --no-cache musl-locales musl-locales-lang icu-data-full icu-libs curl tzdata && \
apk add --no-cache musl musl-utils musl-locales musl-locales-lang icu-data-full icu-libs curl tzdata && \
rm -rf /var/cache/apk/*

echo $TZ > /etc/timezone && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime

echo "export LC_ALL=$LC_ALL" >> /etc/profile.d/locale.sh && \
sed -i "s/LANG=./LANG=$LANG/" /etc/profile.d/locale.sh

adduser -D $USERNAME && \
mkdir -p /etc/sudoers.d && \
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME &&\
Expand Down
16 changes: 8 additions & 8 deletions Aspnet/script-base-debian-like.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends locales tzdata curl wget && \
apt install -y --no-install-recommends locales curl tzdata && \
apt clean && apt autoclean && apt autoremove && \
rm -rf /var/lib/apt/lists/*

echo $TZ > /etc/timezone && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
locale-gen pt_BR.UTF-8 && \
dpkg-reconfigure -f noninteractive locales && \
update-locale LANG=pt_BR.UTF-8 LANGUAGE="pt_BR:pt:en" && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata

groupadd --gid 1000 $USERNAME \
&& useradd -r --uid 1000 --gid 1000 -m $USERNAME
echo "locales locales/locales_to_be_generated multiselect pt_BR.UTF-8 UTF-8" | debconf-set-selections && \
rm /etc/locale.gen && \
dpkg-reconfigure --frontend noninteractive locales

groupadd --gid 1000 $USERNAME && \
useradd -r --uid 1000 --gid 1000 -m $USERNAME
8 changes: 8 additions & 0 deletions Aspnet/script-install-xray-alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

mkdir -p /tmp/xray_output/

curl https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip -o /tmp/xray_output/xray.zip && \
unzip /tmp/xray_output/xray.zip -d /tmp/xray_output && \
mv /tmp/xray_output/xray /usr/bin/xray && \
rm -rf /tmp/xray_output
5 changes: 5 additions & 0 deletions Aspnet/script-install-xray-debian-like.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

curl https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-3.x.deb -o /tmp/xray.deb && \
dpkg -i /tmp/xray.deb && \
rm /tmp/xray.deb

0 comments on commit 63c8a7e

Please sign in to comment.