I have use the Ubuntu Virtualbox.
Docker version : Docker version 20.10.12, build e91ed57
redis version: 3.0
From Ubuntu, I'm trying to initialize and connect to redis-vm server.
I have use following docker commands to build, create container and connect with the redis-server.
(base) root#adminsaturn-virtual-machine:/media/sf_scefwp01/redis# docker build --rm -f ./Dockerfile --tag redis:3.0 .
Sending build context to Docker daemon 1.571MB
Step 1/26 : FROM alpine:20210804 as redis-dev
---> 4e873038b87b
Step 2/26 : ENV REDIS_VERS "6.2.6"
---> Using cache
---> bd2bd3468229
Step 3/26 : ENV REDIS_REPO "https://github.com/redis/redis.git"
---> Using cache
---> 51831b501b6d
Step 4/26 : ENV REDISJSON_VERS "2.0.6"
---> Using cache
---> c9fbf3a205bc
Step 5/26 : ENV REDISJSON_REPO "https://github.com/RedisJSON/RedisJSON.git"
---> Using cache
---> a4d2767081c9
Step 6/26 : RUN apk add --no-cache coreutils gcc g++ cargo linux-headers make musl-dev git rust cargo clang-libs pkgconf
---> Using cache
---> a603a024df55
Step 7/26 : RUN git clone --depth 1 --branch ${REDIS_VERS} ${REDIS_REPO} redis && cd /redis && make -j "$(nproc)" && make install
---> Using cache
---> b784b1ea27e4
Step 8/26 : FROM alpine:3.14
---> dd53f409bf0b
Step 9/26 : RUN sed -i 's/https/http/' /etc/apk/repositories
---> Using cache
---> d5f72fd3c94e
Step 10/26 : RUN apk update && apk add bash
---> Using cache
---> fe89e27870d6
Step 11/26 : RUN apk add libgcc
---> Using cache
---> d4f8dec09ec0
Step 12/26 : RUN apk add --no-cache python3
---> Using cache
---> 558f61bd0567
Step 13/26 : RUN apk add --no-cache py3-pip
---> Using cache
---> f21fc80a1225
Step 14/26 : RUN pip3 install redis
---> Using cache
---> 634aae092977
Step 15/26 : RUN pip3 install pytest
---> Using cache
---> f03644be4ca8
Step 16/26 : COPY sysvar-py/ /sysvar-py/
---> Using cache
---> ca867b2bbc2e
Step 17/26 : ENV REDIS_URL=redis://localhost:6379
---> Using cache
---> 8e4ece4479d3
Step 18/26 : COPY startup/ /startup/
---> Using cache
---> fefed1c53dee
Step 19/26 : COPY --from=redis-dev /usr/local/bin/redis-* /usr/local/bin/
---> Using cache
---> 110bb43f3cfc
Step 20/26 : RUN mkdir /etc/redis
---> Using cache
---> 80f3fc513310
Step 21/26 : COPY --from=redis-dev /redis/redis.conf /etc/redis/
---> Using cache
---> 0fc7280f6738
Step 22/26 : RUN mkdir -p /usr/local/etc/redis
---> Using cache
---> 362645872a09
Step 23/26 : COPY redis.conf /usr/local/etc/redis/
---> Using cache
---> 9c545d22358f
Step 24/26 : EXPOSE 6379/tcp
---> Using cache
---> d41a476122fd
Step 25/26 : WORKDIR /sysvar-py
---> Using cache
---> 0cd5f4246142
Step 26/26 : ENTRYPOINT ["/startup/startup.sh"]
---> Using cache
---> 20ee87c5f5f4
Successfully built 20ee87c5f5f4
Successfully tagged redis:3.0
(base) root#adminsaturn-virtual-machine:/media/sf_scefwp01/redis# docker run --name=redis --publish=6379:6379 --hostname=redis --mount type=bind,source=/run,target=/run --detach redis:3.0
1fe16baec197920588783968fea43ceaba8286117d95b49e4d59b5a840d04241
(base) root#adminsaturn-virtual-machine:/media/sf_scefwp01/redis# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1fe16baec197 redis:3.0 "/startup/startup.sh" 5 seconds ago Exited (1) 4 seconds ago redis
c1aa99b92eca redis "docker-entrypoint.s…" 25 hours ago Exited (0) 25 hours ago funny_nobel
e236678456e2 redis "docker-entrypoint.s…" 25 hours ago Exited (0) 25 hours ago quirky_lovelace
2772ad6a9c9b 4e873038b87b "/bin/sh -c 'apk upd…" 28 hours ago Exited (2) 28 hours ago crazy_cohen
f34c6d1fde05 4e873038b87b "/bin/sh -c 'apk upd…" 28 hours ago Exited (2) 28 hours ago ecstatic_taussig
(base) root#adminsaturn-virtual-machine:/media/sf_scefwp01/redis# docker exec -it redis bash
Error response from daemon: Container 1fe16baec197920588783968fea43ceaba8286117d95b49e4d59b5a840d04241 is not running
Here you can see build and container creating successfully but redis-server exited immediately.
if we apply the docker exec -it redis bash command then getting Error response:Container is not running.
how can I fix this issue?
Kindly provide me suggestion.
Related
I'm a newbie to VM and Docker containers.
I tried to create a docker container with a python app using Tensorflow 2.10 dependency (and some other libraries)
Host: windows 11 Pro
GPU: RTX3070 Laptop
Guest: Ubuntu 22.4 LTS
VM: 6.1.4
Docker: Docker version 20.10.17, build 100c70180f
This is the output of the build process.
Sending build context to Docker daemon 15.6MB
Step 1/10 : FROM python:3.8-slim-buster
---> 5f3ce1d922f0
Step 2/10 : RUN mkdir -p /home/finance_analysis
---> Using cache
---> cf0e3e5db616
Step 3/10 : WORKDIR /home/finance_analysis
---> Using cache
---> e7106cfd59ef
Step 4/10 : RUN groupadd -r group && useradd -g group user
---> Using cache
---> 8a38c429faca
Step 5/10 : RUN chown -R user:group /home/finance_analysis
---> Using cache
---> bbf5a7d24d25
Step 6/10 : COPY requirements.txt requirements.txt
---> Using cache
---> 7165d444e895
Step 7/10 : RUN pip3 install -r requirements.txt
---> Using cache
---> ceb7ebba9465
Step 8/10 : COPY . /home/finance_analysis
---> f4c54500cbe5
Step 9/10 : USER user
---> Running in 0be3e1fc4f83
Removing intermediate container 0be3e1fc4f83
---> bb5fa2aa9954
Step 10/10 : CMD ["python3", "main.py"]
---> Running in a2f4ed4cddca
Removing intermediate container a2f4ed4cddca
---> bac6188bdd4c
Successfully built bac6188bdd4c
Successfully tagged fa:1.0
When I run the the container I get this error message:
he TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
Aborted (core dumped)
Please let me know if there is anything else I forgot to mention.
Thanks.
I tried to use a wheel of Tensorflow 2.3 without AVX instructions but it didn't work.
I have a NODE.js application which will run only in the Windows environment.
I am running docker desktop on windows 10 Enterprise edition. Docker server version: 20.10.14. So I have switched to the windows container in the docker desktop to create a windows container.
When I am running the container using the docker run command, the container does not start and throws the error.
C:\Users\app>docker run -d helloapp:latest -p 8085:8085
7286c4a0d38c87ec09c009a59cdda527f939f7e7b2814c2324f52cd454744658.
docker: Error response from daemon: container 7286c4a0d38c87ec09c009a59 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(174)\vmcomputeagent.exe!00007FF67F5BC00A: (caller: 00007FF67F58ECEA) Exception(2) tid(36c) 80070002 The system cannot find the file specified.
CallContext:[\Bridge_ProcessMessage\ComputeSystemManager_ExecuteProcess\VmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000].
Here is my docker file:
FROM customnode/node:12.14.1
RUN mkdir C:\\applications\\docker-firstapp
COPY myfirstapp C:\\applications\\docker-firstapp
WORKDIR C:\\applications\\docker-firstapp
RUN npm install
ENV PORT=8085
ENV SQL_USER=username
ENV SQL_PASSWORD=passwd
ENV SQL_SERVER=serverip
ENV SQL_SERVER_DB=dbname
ENV SQL_SERVER_PORT=1433
RUN npm run build
CMD ["npm", "run prod", "--port 8085"]
My folder structure:
*+--- myfirstapp
--- .dockerignore
--- Dockerfile*
For building the image:
docker build -t helloapp .
For running the container:
docker run -d helloapp:latest -p 8085:8085
Docker build logs:
C:\Users\app>docker build -t helloapp .
Sending build context to Docker daemon 12.85MB
Step 1/12 : FROM customnode/node:12.14.1
12.14.1: Pulling from customnode/node
e46122273a4e: Pull complete
c37a24ce81a9: Pull complete
Digest: sha256:ccd9d53710c8b8f8fd4bb779afe79bhd8d45dugf44c4ddf7b7f655ea5cbfe540550cd892c
Status: Downloaded newer image for customnode/node:12.14.1
---> 2cb9637cf0ec
Step 2/12 : RUN mkdir C:\\applications\\docker-firstapp
---> Running in b5c9bc1fabe0
Removing intermediate container b5c9bc1fabe0
---> bc300a981554
Step 3/12 : COPY myfirstapp C:\\applications\\docker-firstapp
---> b039e12ed5de
Step 4/12 : WORKDIR C:\\applications\\docker-firstapp
---> Running in a522ca627602
Removing intermediate container a522ca627602
---> fe67791910c9
Step 5/12 : RUN npm install
---> Running in 796e435a9ecf
added 628 packages from 996 contributors in 63.929s
Removing intermediate container 796e435a9ecf
---> 2301e525f348
Step 6/12 : ENV PORT=8085
---> Running in 43b2cfe4f50b
Removing intermediate container 43b2cfe4f50b
---> 56babd0dfc87
Step 7/12 : ENV SQL_USER=username
---> Running in 7a7b5c3164c3
Removing intermediate container 7a7b5c3164c3
---> cff0b54056f6
Step 8/12 : SQL_PASSWORD=passwd
---> Running in 162832e5b80d
Removing intermediate container 162832e5b80d
---> c4cc16d73439
Step 9/12 : ENV SQL_SERVER=serverip
---> Running in 22f010aaa9c6
Removing intermediate container 22f010aaa9c6
---> fba9cb278a2a
Step 10/12 : ENV SQL_SERVER_DB=dbname
---> Running in 37f14891e5ed
Removing intermediate container 37f14891e5ed
---> 22477a823bdd
Step 11/12 : ENV SQL_SERVER_PORT=1433
---> Running in a0b9ec381efd
Removing intermediate container a0b9ec381efd
---> 30bc3fb6d543
Step 12/12 : RUN npm run build
---> Running in f6b3b0c7ec9b
> nodewithtypescript#1.0.0 build C:\applications\docker-firstapp
> tsc
Removing intermediate container f6b3b0c7ec9b
---> da1352245135
Step 12/12 : CMD ["npm", "run prod", "--port 8085"]
---> Running in 744719faa7c3
Removing intermediate container 744719faa7c3
---> 1912b73a80d5
Successfully built 1912b73a80d5
Successfully tagged helloapp:latest
its very strange,when i run docker build ,process paused,just as follows:
docker build -t registry.ap-southeast-1.aliyuncs.com/joyours_dev/cronjobonlinebackgroundtask:v1 -f Dockerfile.prod .
Sending build context to Docker daemon 25.14MB
Step 1/13 : FROM nginx
---> c316d5a335a5
Step 2/13 : COPY ./app /home/
---> Using cache
---> b3b5594156ff
Step 3/13 : WORKDIR /home
---> Using cache
---> e9fcfe5da215
Step 4/13 : ARG PROJECT_DIR=/var/petaplay/simplethai
---> Using cache
---> fa19c2174392
Step 5/13 : ARG MICROSERVICE_DIR=/var/petaplay/simplethai/microservice/
---> Using cache
---> c086111be060
Step 6/13 : ARG SERVICE_NAME=onlineservice
---> Using cache
---> e0e2035a756b
Step 7/13 : RUN mkdir -p $PROJECT_DIR/common/config
---> Running in 9b38ed579980
console stop at Step 7/13,
I am new in Docker, I am trying to create Flink docker image. Docker image is showing created successfully. But I have a doubt, I can not see Flink binaries in /opt path as mentioned in Dockerfile.
How do I know my Flink Docker image is created successfully.
Screenshot from console, few set of commands are highlighted in red color, means is it OK ?
Status showing Flink Docker image is created:
Please help me. Thank you....
Full Log:
sudo /home/develk/cntx_eng/build.sh \
> --job-artifacts /home/develk/cntx_eng/FlinkContextEnginePoc-0.0.1-SNAPSHOT.jar \
> --from-archive /home/develk/cntx_eng/flink-1.4.0-bin-hadoop24-scala_2.11.tgz \
> --image-name contxeng-flink-poc:1.4.0
--job-artifacts
/home/develk/cntx_eng/FlinkContextEnginePoc-0.0.1-SNAPSHOT.jar
--from-archive
JOB_ARTIFACTS_PATH : /home/develk/cntx_eng/FlinkContextEnginePoc-0.0.1-SNAPSHOT.jar
FROM_ARCHIVE : /home/develk/cntx_eng/flink-1.4.0-bin-hadoop24-scala_2.11.tgz
HADOOP_VERSION :
FLINK_VERSION :
-------------------------Arg Values---------------------------
FLINK_DIST : _TMP_/flink.tgz
JOB_ARTIFACTS_TARGET : _TMP_/artifacts
SHADED_HADOOP :
IMAGE_NAME : contxeng-flink-poc:1.4.0
--------------------------------------------------------------
Sending build context to Docker daemon 606.6MB
Step 1/23 : FROM openjdk:8-jre-alpine
---> f7a292bbb70c
Step 2/23 : RUN apk add --no-cache bash snappy libc6-compat
---> Using cache
---> 9e84497f3616
Step 3/23 : ENV FLINK_INSTALL_PATH=/opt
---> Using cache
---> 87bc358ccf00
Step 4/23 : ENV FLINK_HOME $FLINK_INSTALL_PATH/flink
---> Using cache
---> 712ba8d54555
Step 5/23 : ENV FLINK_LIB_DIR $FLINK_HOME/lib
---> Using cache
---> 80e7b085252e
Step 6/23 : ENV FLINK_PLUGINS_DIR $FLINK_HOME/plugins
---> Using cache
---> 7d39101e47d3
Step 7/23 : ENV FLINK_OPT_DIR $FLINK_HOME/opt
---> Using cache
---> 9bff7fc7145d
Step 8/23 : ENV FLINK_JOB_ARTIFACTS_DIR $FLINK_INSTALL_PATH/artifacts
---> Using cache
---> b0c01f3aab84
Step 9/23 : ENV FLINK_USR_LIB_DIR $FLINK_HOME/usrlib
---> Using cache
---> f4236bc26cab
Step 10/23 : ENV PATH $PATH:$FLINK_HOME/bin
---> Using cache
---> 2cb7cd442b6f
Step 11/23 : ARG flink_dist=NOT_SET
---> Using cache
---> 1a6fc691baa2
Step 12/23 : ARG job_artifacts=NOT_SET
---> Using cache
---> e11400e03120
Step 13/23 : ARG python_version=NOT_SET
---> Using cache
---> 313089fd991e
Step 14/23 : ARG hadoop_jar=NOT_SET*
---> Using cache
---> ccbef4dfa806
Step 15/23 : RUN if [ "$python_version" = "2" ]; then apk add --no-cache python; elif [ "$python_version" = "3" ]; then apk add --no-cache python3 && ln -s /usr/bin/python3 /usr/bin/python; fi
---> Using cache
---> 7e6dca36dad4
Step 16/23 : ADD $flink_dist $hadoop_jar $FLINK_INSTALL_PATH/
---> 5afb7a8e5414
Step 17/23 : ADD $job_artifacts/* $FLINK_JOB_ARTIFACTS_DIR/
---> c2789d3d80b3
Step 18/23 : RUN set -x && ln -s $FLINK_INSTALL_PATH/flink-[0-9]* $FLINK_HOME && ln -s $FLINK_JOB_ARTIFACTS_DIR $FLINK_USR_LIB_DIR && if [ -n "$python_version" ]; then ln -s $FLINK_OPT_DIR/flink-python*.jar $FLINK_LIB_DIR; fi && if [ -f ${FLINK_INSTALL_PATH}/flink-shaded-hadoop* ]; then ln -s ${FLINK_INSTALL_PATH}/flink-shaded-hadoop* $FLINK_LIB_DIR; fi && addgroup -S flink && adduser -D -S -H -G flink -h $FLINK_HOME flink && chown -R flink:flink ${FLINK_INSTALL_PATH}/flink-* && chown -R flink:flink ${FLINK_JOB_ARTIFACTS_DIR}/ && chown -h flink:flink $FLINK_HOME
---> Running in c4cb70216f08
+ ln -s /opt/flink-1.4.0 /opt/flink-1.4.0-bin-hadoop24-scala_2.11.tgz /opt/flink
+ ln -s /opt/artifacts /opt/flink/usrlib
+ '[' -n ]
+ '[' -f /opt/flink-shaded-hadoop-2-uber-2.4.1-8.0.jar ]
+ ln -s /opt/flink-shaded-hadoop-2-uber-2.4.1-8.0.jar /opt/flink/lib
+ addgroup -S flink
+ adduser -D -S -H -G flink -h /opt/flink flink
+ chown -R flink:flink /opt/flink-1.4.0 /opt/flink-1.4.0-bin-hadoop24-scala_2.11.tgz /opt/flink-shaded-hadoop-2-uber-2.4.1-8.0.jar
+ chown -R flink:flink /opt/artifacts/
+ chown -h flink:flink /opt/flink
Removing intermediate container c4cb70216f08
---> 459b1156294b
Step 19/23 : COPY docker-entrypoint.sh /
---> d4ae4be34415
Step 20/23 : USER flink
---> Running in 95a2c9234cd5
Removing intermediate container 95a2c9234cd5
---> ebdc913c7dd9
Step 21/23 : EXPOSE 8081 6123
---> Running in f6fad553a1d7
Removing intermediate container f6fad553a1d7
---> 51e6c57d2bde
Step 22/23 : ENTRYPOINT ["/docker-entrypoint.sh"]
---> Running in 09e7c0759fb6
Removing intermediate container 09e7c0759fb6
---> 99cdeb095b8f
Step 23/23 : CMD ["--help"]
---> Running in f985bd546dcf
Removing intermediate container f985bd546dcf
---> 039086df61e6
Successfully built 039086df61e6
Successfully tagged contxeng-flink-poc:1.4.0
Seems like everything went well.
To see which containers are running:
docker ps
contxeng-flink-poc:1.4.0, should be in there.
If you actually want to interact with Flink you should expose some ports.
The Flink dashboard for example runs on port 8081 of your container.
You can also get an interactive bash shell into your container by running the following command (if your container has bash installed):
docker exec -it contxeng-flink-poc:1.4.0 bash
That's where you will find your Flink binaries.
If the container is not running, check if it was built:
docker images
If that's the case, run it:
docker run -d contxeng-flink-poc:1.4.0
I'm trying to deploy the latest scrapinghub/splash
I am using git-bash on win10. I forked the repo to https://github.com/kc1/splash/blob/master
and I have been trying to follow Using docker, scrapy splash on Heroku to modify the docker file
to https://github.com/kc1/splash/blob/master/Dockerfile
but when I run:
$ heroku container:push web --app splash1
=== Building web (E:\ENVS\r3\splash1\Dockerfile)
Sending build context to Docker daemon 5.333MB
Step 1/11 : FROM ubuntu:16.04
---> 2a697363a870
Step 2/11 : ENV DEBIAN_FRONTEND noninteractive
---> Using cache
---> d65460bd23ae
Step 3/11 : ENV PATH="/opt/qt59/5.9.1/gcc_64/bin:${PATH}"
---> Using cache
---> f8ad62632743
Step 4/11 : ADD dockerfiles/splash/provision.sh /tmp/provision.sh
---> Using cache
---> 5fc632a5001f
Step 5/11 : ADD dockerfiles/splash/qt-installer-noninteractive.qs /tmp/script.qs
---> Using cache
---> 174d06a23d89
Step 6/11 : RUN /tmp/provision.sh prepare_install install_deps install_qtwebkit_deps install_official_qt install_qtwebkit install_pyqt5 install_python_deps
install_flash install_msfonts install_extra_fonts remove_builddeps remove_extra && rm /tmp/provision.sh
---> Running in 45dd729ec969
/bin/sh: 1: /tmp/provision.sh: not found
The command '/bin/sh -c /tmp/provision.sh prepare_install install_deps install_qtwebkit_deps install_official_qt install_qtwebkit install_pyqt5 install_pyth
on_deps install_flash install_msfonts install_extra_fonts remove_builddeps remove_extra && rm /tmp/provision.sh' returned a non-zero code: 127
! Error: docker build exited with Error: 127
What am I doing wrong?