Skip to content

Commit 457add1

Browse files
committed
tyr
1 parent 52420b8 commit 457add1

File tree

1 file changed

+2
-92
lines changed

1 file changed

+2
-92
lines changed

Dockerfile

Lines changed: 2 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -27,105 +27,15 @@
2727
# COPY ./docker-entrypoint.sh /
2828
# ENTRYPOINT ["/docker-entrypoint.sh"]
2929
# EXPOSE 3306
30-
31-
FROM debian:buster-slim
32-
33-
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
34-
RUN groupadd -r mysql && useradd -r -g mysql mysql
35-
36-
RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr && rm -rf /var/lib/apt/lists/*
37-
38-
# add gosu for easy step-down from root
39-
# https://github.com/tianon/gosu/releases
40-
ENV GOSU_VERSION 1.12
41-
RUN set -eux; \
42-
savedAptMark="$(apt-mark showmanual)"; \
43-
apt-get update; \
44-
apt-get install -y --no-install-recommends ca-certificates wget; \
45-
rm -rf /var/lib/apt/lists/*; \
46-
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
47-
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
48-
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
49-
export GNUPGHOME="$(mktemp -d)"; \
50-
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
51-
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
52-
gpgconf --kill all; \
53-
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
54-
apt-mark auto '.*' > /dev/null; \
55-
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
56-
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
57-
chmod +x /usr/local/bin/gosu; \
58-
gosu --version; \
59-
gosu nobody true
60-
61-
RUN mkdir /docker-entrypoint-initdb.d
62-
63-
RUN apt-get update && apt-get install -y --no-install-recommends \
64-
# for MYSQL_RANDOM_ROOT_PASSWORD
65-
pwgen \
66-
# for mysql_ssl_rsa_setup
67-
openssl \
68-
# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db:
69-
# File::Basename
70-
# File::Copy
71-
# Sys::Hostname
72-
# Data::Dumper
73-
perl \
74-
# install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files
75-
xz-utils \
76-
&& rm -rf /var/lib/apt/lists/*
77-
78-
RUN set -ex; \
79-
# gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
80-
key='A4A9406876FCBD3C456770C88C718D3B5072E1F5'; \
81-
export GNUPGHOME="$(mktemp -d)"; \
82-
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
83-
gpg --batch --export "$key" > /etc/apt/trusted.gpg.d/mysql.gpg; \
84-
gpgconf --kill all; \
85-
rm -rf "$GNUPGHOME"; \
86-
apt-key list > /dev/null
87-
88-
ENV MYSQL_MAJOR 5.7
89-
ENV MYSQL_VERSION 5.7.30-1debian10
90-
91-
RUN echo "deb http://repo.mysql.com/apt/debian/ buster mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list
92-
93-
# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
94-
# also, we set debconf keys to make APT a little quieter
95-
RUN { \
96-
echo mysql-community-server mysql-community-server/data-dir select ''; \
97-
echo mysql-community-server mysql-community-server/root-pass password ''; \
98-
echo mysql-community-server mysql-community-server/re-root-pass password ''; \
99-
echo mysql-community-server mysql-community-server/remove-test-db select false; \
100-
} | debconf-set-selections \
101-
&& apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}" && rm -rf /var/lib/apt/lists/* \
102-
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
103-
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
104-
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
105-
&& chmod 777 /var/run/mysqld \
106-
# comment out a few problematic configuration values
107-
&& find /etc/mysql/ -name '*.cnf' -print0 \
108-
| xargs -0 grep -lZE '^(bind-address|log)' \
109-
| xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \
110-
# don't reverse lookup hostnames, they are usually another container
111-
&& echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf
112-
113-
VOLUME /var/lib/mysql
114-
115-
COPY docker-entrypoint.sh /usr/local/bin/
116-
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
117-
ENTRYPOINT ["docker-entrypoint.sh"]
118-
119-
EXPOSE 3306 33060
120-
CMD ["mysqld"]
121-
12230
FROM continuumio/anaconda3
12331
# install the notebook package
12432
RUN pip install --no-cache --upgrade pip && \
12533
pip install --no-cache notebook && \
12634
pip install seaborn && \
35+
conda install -c conda-forge docker-compose && \
12736
python -m pip install git+https://github.com/gucky92/datajoint-python.git
12837

38+
EXPOSE 3306
12939
# create user with a home directory
13040
ARG NB_USER
13141
ARG NB_UID

0 commit comments

Comments
 (0)