!6720 openGauss docker更新7.0.0-rc1
Merge pull request !6720 from 胡淳滔/docker_final
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
FROM centos:7.6.1810
|
||||
|
||||
COPY openGauss-5.0.0-CentOS-64bit.tar.bz2 .
|
||||
COPY openGauss-Server-7.0.0-RC1-CentOS7-x86_64.tar.bz2 .
|
||||
COPY gosu-amd64 /usr/local/bin/gosu
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
@ -15,10 +15,10 @@ RUN set -eux; \
|
||||
mkdir -p /usr/local/opengauss && \
|
||||
mkdir -p /var/run/opengauss && \
|
||||
mkdir /docker-entrypoint-initdb.d && \
|
||||
tar -jxf openGauss-5.0.0-CentOS-64bit.tar.bz2 -C /usr/local/opengauss && \
|
||||
tar -jxf openGauss-Server-7.0.0-RC1-CentOS7-x86_64.tar.bz2 -C /usr/local/opengauss && \
|
||||
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
|
||||
chmod 2777 /var/run/opengauss && \
|
||||
rm -rf openGauss-5.0.0-CentOS-64bit.tar.bz2 && yum clean all
|
||||
rm -rf openGauss-Server-7.0.0-RC1-CentOS7-x86_64.tar.bz2 && yum clean all
|
||||
|
||||
RUN set -eux; \
|
||||
echo "export GAUSSHOME=/usr/local/opengauss" >> /home/omm/.bashrc && \
|
||||
@ -1,8 +1,13 @@
|
||||
FROM openeuler-20.03-lts:latest
|
||||
|
||||
COPY openGauss-5.0.0-openEuler-64bit.tar.bz2 .
|
||||
ARG VERSION=7.0.0-RC1
|
||||
|
||||
COPY openGauss-Server-${VERSION}-openEuler20.03-aarch64.tar.bz2 .
|
||||
COPY gosu-arm64 /usr/local/bin/gosu
|
||||
COPY openEuler_aarch64.repo /etc/yum.repos.d/openEuler_aarch64.repo
|
||||
# remove all lines containing scws if do no want to chparser#
|
||||
COPY scws.tar.gz .
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
|
||||
#RUN yum install -y epel-release
|
||||
@ -15,21 +20,25 @@ RUN set -eux; \
|
||||
mkdir -p /usr/local/opengauss && \
|
||||
mkdir -p /var/run/opengauss && \
|
||||
mkdir /docker-entrypoint-initdb.d && \
|
||||
tar -jxf openGauss-5.0.0-openEuler-64bit.tar.bz2 -C /usr/local/opengauss && \
|
||||
tar -jxf openGauss-Server-${VERSION}-openEuler20.03-aarch64.tar.bz2 -C /usr/local/opengauss && \
|
||||
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
|
||||
chmod 2777 /var/run/opengauss && \
|
||||
rm -rf openGauss-5.0.0-openEuler-64bit.tar.bz2 && yum clean all
|
||||
rm -rf openGauss-Server-${VERSION}-openEuler20.03-aarch64.tar.bz2 && \
|
||||
tar -xzvf scws.tar.gz; chown -R omm:omm /scws; rm -rf scws.tar.gz && \
|
||||
chmod 1777 /tmp && \
|
||||
yum clean all
|
||||
|
||||
RUN set -eux; \
|
||||
echo "export GAUSSHOME=/usr/local/opengauss" >> /home/omm/.bashrc && \
|
||||
echo "export PATH=\$GAUSSHOME/bin:\$PATH " >> /home/omm/.bashrc && \
|
||||
echo "export LD_LIBRARY_PATH=\$GAUSSHOME/lib:\$LD_LIBRARY_PATH" >> /home/omm/.bashrc
|
||||
|
||||
RUN set -eux; echo "export TMOUT=0 >> /etc/bashrc"
|
||||
|
||||
ENV GOSU_VERSION 1.12
|
||||
RUN set -eux; \
|
||||
chmod +x /usr/local/bin/gosu
|
||||
|
||||
|
||||
ENV PGDATA /var/lib/opengauss/data
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
50
docker/dockerfiles/7.0.0-rc1/dockerfile_x86
Normal file
50
docker/dockerfiles/7.0.0-rc1/dockerfile_x86
Normal file
@ -0,0 +1,50 @@
|
||||
FROM openeuler-20.03-lts:latest
|
||||
|
||||
ARG VERSION=7.0.0-RC1
|
||||
|
||||
COPY openGauss-Server-${VERSION}-openEuler20.03-x86_64.tar.bz2 .
|
||||
COPY gosu-amd64 /usr/local/bin/gosu
|
||||
COPY openEuler_aarch64.repo /etc/yum.repos.d/openEuler_x86_64.repo
|
||||
# remove all lines containing scws if do no want to chparser#
|
||||
COPY scws.tar.gz .
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
|
||||
#RUN yum install -y epel-release
|
||||
|
||||
RUN set -eux; \
|
||||
yum install -y bzip2 curl libaio shadow tar&& \
|
||||
groupadd -g 70 omm; \
|
||||
useradd -u 70 -g omm -d /home/omm omm; \
|
||||
mkdir -p /var/lib/opengauss && \
|
||||
mkdir -p /usr/local/opengauss && \
|
||||
mkdir -p /var/run/opengauss && \
|
||||
mkdir /docker-entrypoint-initdb.d && \
|
||||
tar -jxf openGauss-Server-${VERSION}-openEuler20.03-x86_64.tar.bz2 -C /usr/local/opengauss && \
|
||||
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
|
||||
chmod 2777 /var/run/opengauss && \
|
||||
rm -rf openGauss-Server-${VERSION}-openEuler20.03-x86_64.tar.bz2 && \
|
||||
tar -xzvf scws.tar.gz; chown -R omm:omm /scws; rm -rf scws.tar.gz && \
|
||||
chmod 1777 /tmp && \
|
||||
yum clean all
|
||||
|
||||
RUN set -eux; \
|
||||
echo "export GAUSSHOME=/usr/local/opengauss" >> /home/omm/.bashrc && \
|
||||
echo "export PATH=\$GAUSSHOME/bin:\$PATH " >> /home/omm/.bashrc && \
|
||||
echo "export LD_LIBRARY_PATH=\$GAUSSHOME/lib:\$LD_LIBRARY_PATH" >> /home/omm/.bashrc
|
||||
|
||||
RUN set -eux; echo "export TMOUT=0 >> /etc/bashrc"
|
||||
|
||||
ENV GOSU_VERSION 1.12
|
||||
RUN set -eux; \
|
||||
chmod +x /usr/local/bin/gosu
|
||||
|
||||
ENV PGDATA /var/lib/opengauss/data
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
RUN chmod 755 /usr/local/bin/entrypoint.sh;ln -s /usr/local/bin/entrypoint.sh / # backwards compat
|
||||
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
EXPOSE 5432
|
||||
CMD ["gaussdb"]
|
||||
@ -7,8 +7,8 @@ set -Eeo pipefail
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
|
||||
export GAUSSHOME=/usr/local/opengauss
|
||||
export PATH=$GAUSSHOME/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
|
||||
export PATH=$GAUSSHOME/bin:/scws/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GAUSSHOME/lib:/scws/lib:$LD_LIBRARY_PATH
|
||||
|
||||
file_env() {
|
||||
local var="$1"
|
||||
@ -207,9 +207,16 @@ EOSQL
|
||||
}
|
||||
|
||||
docker_setup_user() {
|
||||
if [ -n "$GS_USER_PASSWORD" ]; then
|
||||
PASSWORD_FOR_USER="$GS_USER_PASSWORD"
|
||||
else
|
||||
PASSWORD_FOR_USER="$GS_PASSWORD"
|
||||
fi
|
||||
|
||||
if [ -n "$GS_USERNAME" ]; then
|
||||
GS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set user="$GS_USERNAME" <<-'EOSQL'
|
||||
GS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$PASSWORD_FOR_USER" --set user="$GS_USERNAME" <<-'EOSQL'
|
||||
create user :"user" with login password :"passwd" ;
|
||||
grant all privileges to :"user" ;
|
||||
EOSQL
|
||||
else
|
||||
echo " default user is gaussdb"
|
||||
@ -300,6 +307,8 @@ opengauss_setup_postgresql_conf() {
|
||||
if [ -n "$OTHER_PG_CONF" ]; then
|
||||
echo -e "$OTHER_PG_CONF"
|
||||
fi
|
||||
|
||||
echo "session_timeout = 0"
|
||||
} >> "$PGDATA/postgresql.conf"
|
||||
}
|
||||
|
||||
@ -90,9 +90,16 @@ DOCKEROPS=""
|
||||
MIN_DOCKER_VERSION_MAJOR="17"
|
||||
MIN_DOCKER_VERSION_MINOR="09"
|
||||
arch=$(case $(uname -m) in i386) echo "386" ;; i686) echo "386" ;; x86_64) echo "amd64";; aarch64)echo "arm64";; esac)
|
||||
file_arch=""
|
||||
if [ "${arch}" = "amd64" ]; then
|
||||
DOCKERFILE="dockerfile_amd"
|
||||
file_arch="x86_64"
|
||||
if [ -f "/etc/openEuler-release" ];then
|
||||
DOCKERFILE="dockerfile_x86"
|
||||
else
|
||||
DOCKERFILE="dockerfile_amd"
|
||||
fi
|
||||
else
|
||||
file_arch="aarch64"
|
||||
DOCKERFILE="dockerfile_arm"
|
||||
fi
|
||||
|
||||
@ -178,7 +185,29 @@ echo "Building image '$IMAGE_NAME' ..."
|
||||
|
||||
# BUILD THE IMAGE (replace all environment variables)
|
||||
BUILD_START=$(date '+%s')
|
||||
docker build --force-rm=true --no-cache=true \
|
||||
|
||||
if [ -f "/etc/openEuler-release" ];then
|
||||
opengauss_files_tar=(openGauss-Server-*-openEuler20.03-${file_arch}.tar.bz2)
|
||||
if [[ ${#opengauss_files_tar[@]} -ne 1 || ! -f "${opengauss_files_tar[0]}" ]]; then
|
||||
echo "ERROR: unable to choose server pkg"
|
||||
echo "${opengauss_files_tar[0]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
opengauss_tar="${opengauss_files_tar[0]}"
|
||||
opengauss_version=$(echo "${opengauss_tar}" | sed "s/.*openGauss-Server-\(.*\)-openEuler20.03-${file_arch}.tar.bz2/\1/")
|
||||
else
|
||||
opengauss_version=""
|
||||
fi
|
||||
|
||||
echo "version number=${opengauss_version}"
|
||||
|
||||
if [ ! test -f scws.tar.gz ]; then
|
||||
echo "Could not find scws.tar.gz."
|
||||
echo "If chparser will not be used, please modify the dockerfile by removing lines containing scws."
|
||||
fi
|
||||
|
||||
docker build --build-arg VERSION=$opengauss_version --force-rm=true --no-cache=true \
|
||||
$DOCKEROPS $PROXY_SETTINGS \
|
||||
-t $IMAGE_NAME -f $DOCKERFILE . || {
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user