@@ -47,7 +47,6 @@ RUN mkdir $DOWNLOADS_CACHE_DIR
47
47
# Copying bare minimum of Hopsworks cloud environment for now
48
48
FROM rondb_runtime_dependencies as cloud_preparation
49
49
ARG RONDB_VERSION=21.04.16
50
- RUN groupadd mysql && adduser mysql --ingroup mysql
51
50
ENV HOPSWORK_DIR=/srv/hops
52
51
ENV RONDB_BIN_DIR=$HOPSWORK_DIR/mysql-$RONDB_VERSION
53
52
RUN mkdir -p $RONDB_BIN_DIR
@@ -64,8 +63,7 @@ RUN case "$TARGETARCH" in \
64
63
65
64
RUN --mount=type=bind,source=.,target=/context \
66
65
. /env.sh \
67
- && tar xfz /context/${TARBALL_PATH} -C $RONDB_BIN_DIR --strip-components=1 \
68
- && chown mysql:mysql -R $RONDB_BIN_DIR
66
+ && tar xfz /context/${TARBALL_PATH} -C $RONDB_BIN_DIR --strip-components=1
69
67
70
68
# Get RonDB tarball from remote url & unpack it
71
69
FROM cloud_preparation as remote_tarball
@@ -78,8 +76,7 @@ RUN case "$TARGETARCH" in \
78
76
esac \
79
77
&& wget $TARBALL_URL -O ./temp_tarball.tar.gz \
80
78
&& tar xfz ./temp_tarball.tar.gz -C $RONDB_BIN_DIR --strip-components=1 \
81
- && rm ./temp_tarball.tar.gz \
82
- && chown mysql:mysql -R $RONDB_BIN_DIR
79
+ && rm ./temp_tarball.tar.gz
83
80
84
81
FROM ${RONDB_TARBALL_LOCAL_REMOTE}_tarball
85
82
@@ -116,32 +113,35 @@ ENV MYSQL_UNIX_PORT=$RONDB_DATA_DIR/mysql.sock
116
113
117
114
RUN mkdir -p $LOG_DIR $RONDB_SCRIPTS_DIR $BACKUP_DATA_DIR $DISK_COLUMNS_DIR
118
115
119
- COPY --chown=mysql:mysql ./resources/rondb_scripts $RONDB_SCRIPTS_DIR
116
+ COPY ./resources/rondb_scripts $RONDB_SCRIPTS_DIR
120
117
ENV PATH=$RONDB_SCRIPTS_DIR:$PATH
121
118
122
- # So the path survives changing user to mysql
123
- RUN echo "export PATH=$PATH" >> /home/mysql/.profile
124
-
125
119
RUN touch $MYSQL_UNIX_PORT
126
120
127
121
# We expect this image to be used as base image to other
128
122
# images with additional files specific to Docker
129
- COPY --chown=mysql:mysql ./resources/entrypoints ./docker/rondb_standalone/entrypoints
130
- COPY --chown=mysql:mysql ./resources/healthcheck.sh ./docker/rondb_standalone/healthcheck.sh
123
+ COPY ./resources/entrypoints ./docker/rondb_standalone/entrypoints
124
+ COPY ./resources/healthcheck.sh ./docker/rondb_standalone/healthcheck.sh
131
125
132
126
# Can be used to mount SQL init scripts
133
127
ENV SQL_INIT_SCRIPTS_DIR=$HOPSWORK_DIR/docker/rondb_standalone/sql_init_scripts
134
128
RUN mkdir $SQL_INIT_SCRIPTS_DIR
135
129
136
130
# Creating benchmarking files/directories
137
131
# When using load balancers, "sysbench" can be used for both _single and _multi
138
- ENV BENCHMARKS_DIR=/home/mysql /benchmarks
132
+ ENV BENCHMARKS_DIR=$HOPSWORK_DIR /benchmarks
139
133
RUN mkdir $BENCHMARKS_DIR && cd $BENCHMARKS_DIR \
140
134
&& mkdir -p sysbench sysbench_single sysbench_multi dbt2_single dbt2_multi dbt2_data
141
135
142
- # Avoid changing files if they are already owned by mysql; otherwise image size doubles
143
- RUN chown mysql:mysql --from=root:root -R $HOPSWORK_DIR /home/mysql
136
+ # These directories have to have 777 permissions if we want to
137
+ # run RonDB containers with arbitrary users
138
+ RUN chmod 777 -R $RONDB_DATA_DIR \
139
+ && chmod 777 -R $HOPSWORK_DIR/docker \
140
+ && chmod 777 -R $BENCHMARKS_DIR
141
+
142
+ # Remove awkward message when using arbitrary user
143
+ RUN echo "PS1='${debian_chroot:+(\$ debian_chroot)}\h :\w\$ '" >> /etc/bash.bashrc
144
144
145
- ENTRYPOINT ["./docker/rondb_standalone/entrypoints/entrypoint .sh" ]
145
+ ENTRYPOINT ["./docker/rondb_standalone/entrypoints/main .sh" ]
146
146
EXPOSE 3306 33060 11860 1186 4406 5406
147
147
CMD ["mysqld" ]
0 commit comments