1

所以我有以下 Dockerfile:

############################################################
# Based on Ubuntu
############################################################

FROM ubuntu:trusty
MAINTAINER OTIS WRIGHT

# Add extra software sources

RUN apt-get update -qq

# Libsass requirements.

RUN apt-get install -y curl git build-essential automake libtool

# Fetch sources

RUN git clone https://github.com/sass/libsass.git
RUN git clone https://github.com/sass/sassc.git libsass/sassc

# Create configure script

RUN cd libsass
RUN autoreconf --force --install
RUN cd ..

# Create custom makefiles for **shared library**, for more info read:
# 'Difference between static and shared libraries?' before installing libsass  http://stackoverflow.com/q/2649334/802365

RUN cd libsass
RUN autoreconf --force --install
RUN ./configure --disable-tests --enable-shared --prefix=/usr 
RUN cd ..

# Build the library

RUN make -C libsass -j5

# Install the library

RUN make -C libsass -j5 install

我正在尝试libsass基于此要点进行构建: https ://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87

但是,当我尝试使用 docker 构建时,出现以下错误:

Step 11 : RUN git clone https://github.com/sass/libsass.git
 ---> Using cache
 ---> d1a4eef78fa5
Step 12 : RUN git clone https://github.com/sass/sassc.git libsass/sassc
 ---> Using cache
 ---> 435410579641
Step 13 : RUN cd libsass
 ---> Using cache
 ---> f0a4df503d85
Step 14 : RUN autoreconf --force --install
 ---> Running in a9b0d51d6ee3
autoreconf: 'configure.ac' or 'configure.in' is required
The command '/bin/sh -c autoreconf --force --install' returned a non-zero code: 1

我不太了解从源代码编译,所以任何解决方案都请引导我完成。

4

1 回答 1

1

Docker 不会为您更改目录,RUN cd libsass因此您需要路径命令或使用WORKDIR指令

于 2016-05-14T05:41:52.760 回答