I have successfully built an image and if I go in through bash, I am able to execute "lua" from the command line.
Here is part of the build:
FROM debian:latest
RUN apt-get -y update && apt-get -y install lua5.1 lua-socket lua-sec
CMD [“lua”]
When I run the docker image, the error I keep getting is:
/bin/sh: 1: [“lua”]: not found
When I build it with:
CMD ["/usr/bin/lua"]
I then get this when I run it:
/bin/sh: 1: [“/usr/bin/lua”]: not found
What am I doing wrong?
Related
I tried sudo apt-get amazon-linux-extras
It is ubuntu, so I don't have yum on the machine and I can't find the repo to download amazon-linux-extras
EDIT
I am trying to run make to build cpp code base and I get following error
/bin/sh: 2: autoreconf: not found
I tried to make the question as reproducible as possible. So here is the docker commands:
docker run --name headless_test -ti python:3.6-jessie /bin/bash
And inside the docker execute the following lines:
apt update && apt install -y git xvfb xorg-dev cmake
pip3 install glfw
mkdir /projects
git clone https://github.com/glfw/glfw.git /projects/glfw
cd /projects/glfw
cmake -DBUILD_SHARED_LIBS=ON .
make
export PYGLFW_LIBRARY=/projects/glfw/src/libglfw.so
xvfb-run python -c "import glfw; glfw.init(); glfw.window_hint(glfw.VISIBLE, False); glfw.create_window(100, 100, 'hidden window', None, None)"
this fails with the following error:
GLX: Failed to find a suitable GLXFBConfig
executing xvfb-run glxinfo (after installing mesa-utils) returns the following:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: couldn't find RGB GLX visual or fbconfig
EDIT: This works great if I use the ubuntu docker
So I'm trying to build a new docker image with Python2.7 and pip for python 2.7 however I'm getting a "The command '/bin/sh -c pip2 install -r requirements.txt' returned a non-zero code: 1" error when trying to build the image.
FROM colstrom/python:legacy
MAINTAINER **REDACTED**
RUN pip2 install -r requirements.txt
CMD ["python2.7", "parser.py"]
Any ideas?
You have to COPY/ADD or mount your data (at least requirements.txt and parser.py) into the container.
Assuming your Dockerfile resides at the root directory of your project:
FROM colstrom/python:legacy
MAINTAINER **REDACTED**
COPY . .
RUN pip2 install -r requirements.txt
CMD ["python2.7", "parser.py"]
when I am at C:\Python27\python.exe
When I key in: 'cd\' and it appeared: '...'. I key in 'cd python2.7' and it appeared: 'Syntax Error: invalid syntax'.
so I try again.
I key in: 'cd\' and key in: 'python -m pip install -U pip'. It appeared : 'Syntax Error: invalid syntax'.
How should I solve it?
pip command is not a Python syntax :)
It’s an executable file. To run it from Python you have to use subprocess module. But for single run see below.
Just run it in cmd.exe console (press Ctrl+R, type cmd.exe, press Enter), not in python.exe:
python -m pip install -U pip
pip install -U pywinauto
or with full path (if you have few Pythons installed):
C:\Python34\Scripts\pip.exe install -U pywinauto
I was able to run the C++ Program and build & test it using GitLab CI unit with the help of Docker Image of gcc. But now I want to compile the program in docker using cmake instead of g++. How to change the '.gitlab-ci.yml' file to support cmake.
Current File : .gitlab-ci.yml
image: gcc
before_script:
- apt-get install --yes cmake libmatio-dev libblas-dev libsqlite3-dev libcurl4-openssl-dev
- apt-get install --yes libarchive-dev liblzma-dev
build:
script:
- ./runner.sh
- ./bin/hello
./runner.sh
cmake -H. -Bbuild
cmake --build build -- -j3
I think you need to add apt-get update in order to get cmake to install. See this
image: gcc
before_script:
- apt-get update --yes
- apt-get install --yes cmake
build:
script:
- ./runner.sh
- ./bin/hello
In general, you can figure stuff out by jumping into the docker image to debug (in your case the image is the debian-based gcc:latest):
sudo docker run -it --rm gcc
If you had run your original apt-get install command inside the gcc container, you would have seen following error message that you could have then googled to figure out that apt-get update was needed
sudo docker run -it --rm gcc apt-get install --yes cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package cmake is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'cmake' has no installation candidate
As this blog post mentions, you can do a test run locally by downloading the gitlab-runner executable:
gitlab-runner exec docker build
Running the gitlab-runner locally will have gitlab clone your repo and run through all the steps in the .gitlab-ci.yml and you can see the output and debug locally rather quickly.